Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Beginners guide to Net::FTP

by runrig (Abbot)
on Aug 14, 2002 at 17:16 UTC ( #190164=note: print w/ replies, xml ) Need Help??


in reply to Beginners guide to Net::FTP

Its good that you check the status of the FTP calls, but if they do fail, you may want to include the specific error message (which many mistakenly believe is in $! but is not). On the Net::FTP->new() call, the error message is in $@, and after you have a valid Net::FTP object (e.g. $ftp), you can call $ftp->message.

Another common mistake is to wrap the $ftp->message in quotes, e.g. $ftp->login('user','passwd') or die "Couldn't login: $ftp->message". If you do that, you'll get a very unhelpful error message :-)


Comment on Re: Beginners guide to Net::FTP
Download Code
Re^2: Beginners guide to Net::FTP
by Aristotle (Chancellor) on Aug 14, 2002 at 21:43 UTC
    Which can always be remdied by some further wrapping. :-) $ftp->login('user','passwd') or die "Couldn't login: @{[ $ftp->message ]}";
    ____________
    Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://190164]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (10)
As of 2014-09-18 18:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (120 votes), past polls