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

I apologize if I'm missing something, but I still don't see how this helps me. I believe what I'm after is exception handling.. My Mech agent submits a query to the server and gets disconnected, and I get a fatal error at the command line (server: timeout). I just want to be able to restart at the failed iteration of my loop without having to manually execute the script again..? I can't continue or exit the loop; My program dies upon being disconnected.
  • Comment on Re^2: WWW::Mechanize agent timing-out from server

Replies are listed 'Best First'.
Re^3: WWW::Mechanize agent timing-out from server
by Anonymous Monk on Jul 30, 2009 at 01:21 UTC
    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"; } }