If the problem is a slow server then just tell LWP::Simple to tell LWP::UserAgent to timeout - (no need to alarm() yourself):
use LWP::Simple qw($ua get); # export the underlying LWP::UserAgent in +to $ua ... $ua->timeout(10); # ... and set a timeout on it (seconds) my $doc = get('...') || die {$pass=0};
bw, bliako
In reply to Re: get() from website hangs
by bliako
in thread get() from website hangs
by jeffw_00
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |