columbiaRiver
asked on
Net/Ftp
I installed ActivePerl on my Win98. But still have the following error-
Can't locate Net/FTP.pm in @INC (@INC contains: C:/Program Files/Perl/lib C:/Pro
gram Files/Perl/site/lib .) at ftpperl.pl line 2.
BEGIN failed--compilation aborted at ftpperl.pl line 2.
my perl -
#!/usr/bin/perl
use Net::FTP;
$ftp = Net::FTP->new("222.111.101 .69") || die "could not connect: $!";
$ftp->login("yyyy", "xxxx");
$ftp->cwd("/pub");
$ftp->binary;
$ftp->get("fff);
Can't locate Net/FTP.pm in @INC (@INC contains: C:/Program Files/Perl/lib C:/Pro
gram Files/Perl/site/lib .) at ftpperl.pl line 2.
BEGIN failed--compilation aborted at ftpperl.pl line 2.
my perl -
#!/usr/bin/perl
use Net::FTP;
$ftp = Net::FTP->new("222.111.101
$ftp->login("yyyy", "xxxx");
$ftp->cwd("/pub");
$ftp->binary;
$ftp->get("fff);
ASKER
I don't find libnet.zip at cpan.org, nor can I find ftp in net/ at the site. Can you give more detail on where to download?
ASKER
I don't find libnet.zip at cpan.org, nor can I find ftp in net/ at the site. Can you give more detail on where to download?
ASKER
I installed libnet.pm according to the instrutions. But still have the same error. I put libnet.pm in perl/lib/ Anything wrong?
Probably you do not have Net/FTP.pm in one of the directories specified in INC:
C:/Program Files/Perl/lib
or C:/Program Files/Perl/site/lib
or . (the current directory)
I don't know if the 'libnet' includes it, but if it does, it was not installed correctly.
C:/Program Files/Perl/lib
or C:/Program Files/Perl/site/lib
or . (the current directory)
I don't know if the 'libnet' includes it, but if it does, it was not installed correctly.
ASKER
According to the documentation on the libnet bundle, the ftp module should be ârt of it. I suppose you did not have a full libnet distribution installed. When you say: 'I installed libnet.pm according to the instrutions' does this mean you only installed a single module file ? The libnet bundle contains many files to be installed.
Anyway, you can find a correct libnet distribution at:
http://www.perl.com/CPAN-local/modules/by-module/Net/libnet-1.0703.tar.gz
Get this and install it following the guidelines in the Readme file in the distribution. This should install all you need to ftp away.
Anyway, you can find a correct libnet distribution at:
http://www.perl.com/CPAN-local/modules/by-module/Net/libnet-1.0703.tar.gz
Get this and install it following the guidelines in the Readme file in the distribution. This should install all you need to ftp away.
By re-reading this, I saw you are running the ActiveState (Windows) version. Here is a simpler way to get the package installed using PPM:
First get connected to the internet.
Then, in a command line window type:
C:> ppm
This would run the ppm program from ActiveState. It allows you to install packages without any need to compile anything. Just type:
PPM> search libnet
Following message appears (it does in my case):
Packages available from http://www.ActiveState.com/packages:
libnet
To install, just type:
PPM> install libnet
and all the work will be done, just be patient for a while.
There is also a command
PPM> help
that explains what ppm can do, if you are interested.
Hope this works for you.
First get connected to the internet.
Then, in a command line window type:
C:> ppm
This would run the ppm program from ActiveState. It allows you to install packages without any need to compile anything. Just type:
PPM> search libnet
Following message appears (it does in my case):
Packages available from http://www.ActiveState.com/packages:
libnet
To install, just type:
PPM> install libnet
and all the work will be done, just be patient for a while.
There is also a command
PPM> help
that explains what ppm can do, if you are interested.
Hope this works for you.
ASKER
Thanks. After installation, I tried compiling my perl script again and seems passed the original error. But now point to a config error of ftp -
syntax error at C:/Program Files/Perl/site/lib/Net/Co nfig.pm line 86, near ">"
Compilation failed in require at C:/Program Files/Perl/site/lib/Net/FTP.pm line
21.
BEGIN failed--compilation aborted at C:/Program Files/Perl/site/lib/Net/FTP.pm l
ine 21.
Compilation failed in require at ftpperl.pl line 2.
BEGIN failed--compilation aborted at ftpperl.pl line 2.
I checked config.pm line 86, it's the config info -
DATA>%NetConfig = (
ftp_int_passive => '0',
snpp_hosts => [],
inet_domain => undef,
test_exist => '1',
daytime_hosts => [],
ph_hosts => [],
time_hosts => [],
smtp_hosts => ['mail.mdo.net'],
ftp_ext_passive => '0',
ftp_firewall => undef,
test_hosts => '0',
nntp_hosts => ['news.gt.ca'],
pop3_hosts => ['mail.mdo.net'],
);
syntax error at C:/Program Files/Perl/site/lib/Net/Co
Compilation failed in require at C:/Program Files/Perl/site/lib/Net/FTP.pm line
21.
BEGIN failed--compilation aborted at C:/Program Files/Perl/site/lib/Net/FTP.pm l
ine 21.
Compilation failed in require at ftpperl.pl line 2.
BEGIN failed--compilation aborted at ftpperl.pl line 2.
I checked config.pm line 86, it's the config info -
DATA>%NetConfig = (
ftp_int_passive => '0',
snpp_hosts => [],
inet_domain => undef,
test_exist => '1',
daytime_hosts => [],
ph_hosts => [],
time_hosts => [],
smtp_hosts => ['mail.mdo.net'],
ftp_ext_passive => '0',
ftp_firewall => undef,
test_hosts => '0',
nntp_hosts => ['news.gt.ca'],
pop3_hosts => ['mail.mdo.net'],
);
There should be no "DATA>%" on that line
it should be just
%NetConfig = (
%NetConfig = (
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It is not a bundled module so you will not have it be default.