my $content = get( $url ) or next;
my $content = get( $url );
if (! defined $content )
{
print "Cannot get $url ($!)\n";
sleep(5);
next;
}
When the script reachers a web-site which is down, it just stucks on get( $url ).
use the abstract web browser $ua of LWP
use LWP::Simple qw(get $ua);
However, if you do this, you have do export everything you want to use.
$ua->agent('My agent/1.0');
$ua->timeout(30); # time out after 30 seconds
my $content = get $url ¦¦ die "Timed out!";
More reading here:
[perldoc.strangesoft.net...]
[perlmonks.thepen.com...]
Regards,
R.