Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Beginners guide to Net::FTP

by runrig (Abbot)
on Aug 14, 2002 at 17:16 UTC ( [id://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 :-)

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://190164]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2024-03-19 06:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found