Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Net::FTP problem

by Anonymous Monk
on Jun 05, 2002 at 17:40 UTC ( [id://171929]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I inherited an FTP program which uses the Net::FTP package. I was running the program on perl version 5.003 with no problems. When my company upgraded to perl v5.6.1, the program fails on login to the host machine.
$ftp = new Net::FTP($host, Debug => $debug, Timeout => $timeout, Firew +all => $firewall); unless ($ftp) { #not important } else { print("Connected to $host...\n"); if ( $ftp->login( $acct, $pwd ) { print("Logged in...\n"); } else { if ( ${*$ftp}{'net_cmd_code'} >= 300 ) { die("Bad account and/or password.\n"); } } }
i tried to windiff the versions of the Net::FTP between 5.003 and 5.6.1, but the differences are too many. I also tried to search for 'net_cmd_code' in both versions of FTP.pm except this did not help at all. Does someone know the difference between the versions that would cause this problem. btw, i'm running this code on winNT4 SP6. thanks, michael

Replies are listed 'Best First'.
Re: Net::FTP problem
by c-era (Curate) on Jun 05, 2002 at 17:54 UTC
    Are you running ActiveState perl? If you are, you should try re-installing libnet (instructions below). I've found that most of the libnet modules don't work well out of the box from ActiveState.

    To install libnet:
    1. run 'ppm'
    2. type 'install libnet'
    3. answer 'y' to when it askes you if you want to install
    4. after a bit, it will ask you if you want to install again (it detected a previous version) answer yes
    5. you can accept the defaults from here on out (unless you want to change something)

      Yes. I am running ActiveState perl and I tried to run ppm (like you said), but it said that Version 1.07 of 'libnet' is already installed. Remove it, or use 'verify --upgrade libnet' So, I tried the 'verify'. it took about a minute to run, but when i tried the ftp program again, it ended up with the same result as before. Michael
        Can you post your code exactly? (I know this isn't it because you are missing a ')' at line 8) Also, post any errors that you are receiving. It may also help to turn on debuging to see if there is a network problem.
Re: Net::FTP problem
by joealba (Hermit) on Jun 05, 2002 at 18:29 UTC
    What are the error messages you get in Debug mode?
      Thanks for your reply/time. you guys helped me solve the problem. Setting the debug flag told me that when i was logging on to the FTP server, i was only using 'user acct' rather than 'user acct@host' thanks again, michael

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://171929]
Approved by Rex(Wrecks)
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-04-18 23:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found