Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: How to catch Net::FTP timeouts ?

by steves (Curate)
on Sep 24, 2004 at 12:10 UTC ( [id://393469]=note: print w/replies, xml ) Need Help??


in reply to How to catch Net::FTP timeouts ?

You can catch anything using eval blocks:

eval {$ftp->get("that.file")}; if ($@ =~ /Timeout/) { # catching code goes here }
Net::FTP also lets you set the timeout value, so you could try increasing it if that's the problem.

Replies are listed 'Best First'.
Re^2: How to catch Net::FTP timeouts ?
by Limbic~Region (Chancellor) on Sep 24, 2004 at 12:54 UTC
    steves,
    You can catch anything using eval blocks:

    Absolutes are seldom absolute....

    eval { exit }; print "I caught it\n" if $@;

    Cheers - L~R

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://393469]
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: (4)
As of 2024-04-25 10:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found