There's more than one way to do things | |
PerlMonks |
Re^5: WWW::Mechanize - error on geting non-existing pageby Limbic~Region (Chancellor) |
on Nov 09, 2011 at 17:06 UTC ( [id://937127]=note: print w/replies, xml ) | Need Help?? |
Your Mother,
If instead of: You can also just set onerror => undef which is easier and less error prone than eval/try style code. You had said: This behavior can be turned off by either setting onerror to undef or by turning autocheck off in the constructor. The purpose behind this was the author's attempt to protect new users from themselves. Just as you shouldn't assume that your call to open was successful, you shouldn't assume your call to get was either. It will be your responsibility to check each success for is_success/status and handle any recoverable situations yourself if you do this. I would never have commented. Personally, I like having the code blow up to remind me of places I haven't properly checked the status and leave it on by default but I can see your point as well. Cheers - L~R
In Section
Seekers of Perl Wisdom
|
|