Home: Perl Programming Help: Beginner:
i need to alter this script


Mar 26, 2001, 1:54 PM

Views: 249
i need to alter this script

i had an email script running however the module no longer exists in the default place i an am not able to get it put back, i need to put the module in my own cgi-bin directory, which i have done but how do i get the script to find it as it only trys to look in the original default directory, the module is NET::POP3 and the file is called POP3.pm

see the following top few lines


# ****** USE THIS STUFF *******
#use diagnostics;
use CGI; my $amail=CGI->new(); # THIS IS THE MAIN CGI OBJECT
#use CGI::Pretty; my $amail=CGI->new(); # THIS IS THE MAIN CGI OBJECT
use Net::POP3;
use Time::Local;
use Amail_common;
use Fcntl qw(:DEFAULT :flock);

I am new to perl and this is confusing me

Many thanks in advance

R Martin


Mar 27, 2001, 10:06 AM

Views: 239
Re: i need to alter this script

If you're going to put the module in you cgi-bin directory do the following:
1. Create a directory called 'Net' in you cgi-bin directory and place the POP3.pm file in that directory.
2. Now in your script file place the following line just under you "use diagnostics" line:
"use lib qw(/path/to/cgi-bin);"

You should now be able to use the Net::POP3 module.

If you have problems read the following article on installing perl modules in non-default directories: