Solved

Net/Ftp

Posted on 2000-04-28
12
465 Views
Last Modified: 2008-03-06
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);
0
Comment
Question by:columbiaRiver
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
  • +1
12 Comments
 
LVL 3

Expert Comment

by:jyu_88
ID: 2761473
Net::FTP is a module, which comes with libnet.zip from CPAN.org's ftp site.
It is not a bundled module so you will not have it be default.
0
 

Author Comment

by:columbiaRiver
ID: 2761492
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?
0
 

Author Comment

by:columbiaRiver
ID: 2761494
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?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:columbiaRiver
ID: 2762515
I installed libnet.pm according to the instrutions. But still have the same error.  I put libnet.pm in perl/lib/  Anything wrong?
0
 
LVL 2

Expert Comment

by:bertvermeerbergen
ID: 2762655
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.
0
 

Author Comment

by:columbiaRiver
ID: 2763064
bertvermerbergen
I thinkyou are right.  libnet doesn't include ftp.pm. I was able to download tftp.pm and installed correctly. I just can't find ftp.pm any where on CPAN.org site.
Any suggestion?
0
 
LVL 2

Expert Comment

by:bertvermeerbergen
ID: 2764257
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.

0
 
LVL 2

Expert Comment

by:bertvermeerbergen
ID: 2764268
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.
0
 

Author Comment

by:columbiaRiver
ID: 2764996
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/Config.pm line 86, near "&gt"

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&gt%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'],
);
0
 
LVL 84

Expert Comment

by:ozo
ID: 2765265
There should be no "DATA&gt%" on that line
0
 
LVL 84

Expert Comment

by:ozo
ID: 2765266
it should be just

%NetConfig = (
0
 
LVL 2

Accepted Solution

by:
bertvermeerbergen earned 30 total points
ID: 2766692
ppm is using XML syntax for its packaging description.
This could be an error in ActiveState's files (a missing ';' maybe, as in DATA>).
Maybe you should send them a mail with the faulty Config.pm attached.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
iSeries PERL Scripts 7 207
Insert Text into odbc.ini file 15 75
Call Shell Script from Perl Script 6 199
parse a file and get data out 11 140
I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question