http://www.perlmonks.org?node_id=937127


in reply to Re^4: WWW::Mechanize - error on geting non-existing page
in thread WWW::Mechanize - error on geting non-existing page

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

  • Comment on Re^5: WWW::Mechanize - error on geting non-existing page