Subject: | WWW::Mechanize doesn't seem to handle a www site timing out |
I'm trying to connect to a site with WWW::Mechanize that happens to be down tonight. And I'm getting the following error:
Can't call method "value" on an undefined value at /usr/lib/perl5/site_perl/5.6.1/WWW/Mechanize.pm line 346, <STDIN> line 1.
I'm using the following code to product the error on a site that isn't responding:
my $agent = WWW::Mechanize->new(timeout => 5) or
print "Can't connect to $ap by www";
$agent->get("https://$ap_ip");