in reply to Re^2: WWW::Mechanize agent timing-out from server
in thread WWW::Mechanize agent timing-out from server

sub myprogram { ... } # your program, which die on error while(1){ if( eval { myprogram(); 1 } ){ print "Program finished without dying, quitting\n"; last; } else { print "uh oh, myprogram() died : $@ \n retrying \n"; } }