Try using
BEGIN {
$ENV{PATH}.="../libnet/net";
}
You may wish to print your "path" and other environment variables just to
see what you are getting when you enter Perl...
#!/usr/local/bin/perl5.00502
print "Content-Type:text/html\n\n";
print <<EndOfHTML;
<html><head><title>Print Environment</title></head>
<body>
EndOfHTML
print "I am at " . `pwd` . "<br>\n";
foreach $key (sort(keys %ENV)) {
if ($key eq 'PATH')
{
@paths=split /:/, $ENV{$key};
if ($#path > 0)
@paths=split /:/, $ENV{$key};
if ($#path > 0)
{
print "$key = $ENV{$key}<br>\n";
}
else
{
print "PATHS are:<br><center>\n";
foreach $path (@paths)
{
print "$path<br>";
}
print "</center>";
}
}
else
{
print "$key = $ENV{$key}<br>\n";
}
}
print '<p><b>INC follows:</b><p>';
foreach $b (@INC) {
print '$INC[' . $i++ . "]= $b<br>\n";
}
print "</body></html>";
John W Moon
-----Original Message-----
From: Al Hospers [mailto:[EMAIL PROTECTED]]
Sent: June 08, 2001 14:02
To: [EMAIL PROTECTED]
Subject: using modules installed in local CGI bin
hi,
I have a project that I am working on that I need to FTP some data from a
server to another server. I used Net::FTP from libnet to do it. I tested it
on my local machine & it works fine, did the job. however when tried it on
my site I found out that libnet was not installed. <sigh> contacting the
hosting company they said they would not install libnet in the Perl
libraries. so, I got the bundle from CPAN, copied them into my local CGI
bin & installed them. the Makefile seemed to go OK. HOWEVER, I cannot get my
script to find the modules.
here's the initial part of the code. according to the error message it fails
on line 4 where it cannot find the Net::FTP module.
#!/usr/local/bin/perl
use CGI qw(:all);
use lib "/libnet/Net";
use Net::FTP;
print header;
my script is in a folder called weather in the CGI directory. the Net folder
containing the FTP module is in a folder called libnet off the root of CGI.
like this:
CGI
libnet
Net
FTP.pm
weather
weather_ftp.cgi
any help would be appreciated.
Al Hospers
CamberSoft, Inc.
al<at>cambersoft<dot>com
http://www.cambersoft.com
A famous linguist once said:
"There is no language wherein a double
positive can form a negative."
YEAH, RIGHT