rlopes has asked for the wisdom of the Perl Monks concerning the following question:

My script dies after a recurrent $mech->click() error(it returns Error POSTing example.com: Internal Server Error at test.pl line 46).

As I said, this is a recurrent error (it happens once in a while), and I don't have the need to fix it. Is there anyway to tell Perl to simply ignore it instead of dying?

Ps: I'm using WWW::Mechanize.

Replies are listed 'Best First'.
Re: Ignore $mech->click() errors
by almut (Canon) on Oct 25, 2009 at 13:59 UTC
    Is there anyway to tell Perl to simply ignore it instead of dying?

    Not exactly sure about the context of your question... but maybe you want to unset autocheck (i.e. pass autocheck => 0 to the mech constructor), or wrap the call in question into an eval {...}, which would be Perl's generic way to catch exceptions.

Re: Ignore $mech->click() errors
by bichonfrise74 (Vicar) on Oct 25, 2009 at 17:53 UTC
    Have you checked what the Internal Server errors are? This was asked by Corion before on your node.