Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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

by Limbic~Region (Chancellor)
on Nov 09, 2011 at 17:06 UTC ( #937127=note: print w/ replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://937127]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2014-12-27 17:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls