Hi,
In general you are right about eval { ...; 1 } or do { ... } being better than eval { ... }; if ($@) { ... }, however note this
eval { $mech->get( $imgsrc ); }; if( not $mech->res->is_success ){ ... }
is quite different from all the other snippets of code so far: it only checks $mech->res->is_success, as opposed to all the other examples which would report any error inside an eval, so personally I'd recommend those other patterns over this particular example.
Regards,
-- Hauke D
In reply to Re^4: handling WWW::Mechanize Error GETing
by haukex
in thread handling WWW::Mechanize Error GETing
by NoSyu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |