However at some point during the process, the script abruptly dies.
You could try to unset autocheck in the constructor (and then handle errors yourself, of course):
my $mech = WWW::Mechanize->new( autocheck => 0 ); ...
When enabled (which is the default in newer1 versions of WWW::Mechanize), any errors make the program die. You seem to have a newer version...
___
1 from the Changes file:
1.49_01 Sat Sep 27 23:50:04 CDT 2008 ======================================== [THINGS THAT MAY BREAK YOUR CODE] The autocheck argument to the constructor is now ON by default, unless WWW::Mechanize is being subclassed. There are so many new programmers whose ->get() calls fail unchecked that I'm now putting on the seat belts for them.
In reply to Re: Perl Mechanize Woes
by almut
in thread Perl Mechanize Woes
by listanand
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |