Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by Limbic~Region (Chancellor)
on Nov 09, 2011 at 17:06 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://937127]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-24 18:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found