snaporaz has asked for the wisdom of the Perl Monks concerning the following question:
My question is: is there any way I can make sure that "eval" (or something else) catches every error that the "get" method returns, so that the script can go on? Thanks for your help, this is driving me crazymy $browser = WWW::Mechanize->new( autocheck=>1, agent=>"Firefox/1.0 ( +compatible; MSIE 6.0)"); my $url=... some url ...; my $filename=... local path name ...; my $response; eval { $response=$browser->get( $url, ":content_file" => "C:/$filename +" ) }; if ($@) { print "An error occurred ($@), continuing\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: catch errors using Mechanize
by chanakya (Friar) on May 17, 2005 at 05:26 UTC | |
|
Re: catch errors using Mechanize
by thcsoft (Monk) on May 17, 2005 at 02:00 UTC | |
|
Re: catch errors using Mechanize
by cbrandtbuffalo (Deacon) on May 17, 2005 at 16:13 UTC |