Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: www::mechanize - how to prevent it dying?

by Corion (Patriarch)
on Oct 06, 2010 at 08:03 UTC ( #863733=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $mech = WWW::Mechanize->new( autocheck => 0 );
    my $res = $mech->get('does.notexist.example');
    $res->is_success
        or print "Uhoh\n";
    
  2. or download this
    my $mech = WWW::Mechanize->new();
    my $connected = eval {
    ...
    if (! $connected) {
        print "Uhoh\n";
    };
    
  3. or download this
    use Try::Tiny;
    
    ...
        print "Uhoh: $_\n";
    };
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://863733]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2022-10-02 00:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (6 votes). Check out past polls.

    Notices?