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";
    };