Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

WWW::MECHANIZE Get Errors Ending Program Early?

by jdlev (Scribe)
on Feb 09, 2010 at 19:35 UTC ( #822262=perlquestion: print w/ replies, xml ) Need Help??
jdlev has asked for the wisdom of the Perl Monks concerning the following question:

Every once in a while, I'm getting a "GET" error on my program. I am fairly certain it is the website that is down. Rather than stopping the program and throwing off this error, is there a way to simply restart the program from the top? Thanks!
I love it when a program comes together - jdhannibal

Comment on WWW::MECHANIZE Get Errors Ending Program Early?
Re: WWW::MECHANIZE Get Errors Ending Program Early?
by Corion (Pope) on Feb 09, 2010 at 19:38 UTC

    The module's name is WWW::Mechanize. Perl is picky about the capitalization of module names, so it's better to use a consistent, and preferrably the correct way of writing a module name.

    The WWW::Mechanize documentation points out the autocheck parameter that you can give to the constructor if you promise to check the results of your calls to ->get etc. yourself.

Re: WWW::MECHANIZE Get Errors Ending Program Early?
by pileofrogs (Priest) on Feb 09, 2010 at 20:38 UTC

    The really generic way to do it would be to stick it in a loop and eval { } your get call.

    In Perl, eval { } is what you use to catch exceptions. See eval.

Re: WWW::MECHANIZE Get Errors Ending Program Early?
by zentara (Archbishop) on Feb 10, 2010 at 18:07 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://822262]
Approved by Corion
Front-paged by ikegami
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2014-12-21 18:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (106 votes), past polls