Edenfuma has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use WWW::Mechanize; my $alias = 'Linux Mozilla'; our $mech = WWW::Mechanize->new(agent => $alias); $mech->stack_depth(0); $mech->timeout(10); my $url = "http://www.nonexistent.com"; if ($mech->get($url)){ print 'OK'.$/; } else { print 'ERROR'.$/; }
#!/usr/bin/perl use WWW::Mechanize; my $alias = 'Linux Mozilla'; our $mech = WWW::Mechanize->new(agent => $alias); $mech->stack_depth(0); $mech->timeout(10); my $url = "http://www.nonexistent.com"; my $response = $mech->get($url); if ($response->is_success) { print 'OK'.$/; } else { print 'ERROR'.$/; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with a blocked page using WWW::Mechanize
by Anonymous Monk on Apr 19, 2012 at 15:34 UTC | |
by Edenfuma (Initiate) on Apr 19, 2012 at 15:42 UTC |