http://qs321.pair.com?node_id=800725

Gangabass has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
i need a way to check if request result was bad (i mean no connection etc.). At this time i check each request with eval:

GET_START: eval { $mech->get( $CONFIG{BASE_URL} ); }; if ($@) { sleep $CONFIG{DELAY}; goto GET_START; }

But this is so ugly. I'm sure i need to subclass WWW::Mechanize but don't know how. Also i need to check for errors on each request (submit_form, get, follow_link etc.). How i can do this?