in reply to Re^5: Cookie protected web page and file downloading
in thread Cookie protected web page and file downloading

Instead of manually checking the success/failure after each step, I found it more convenient to have the Mechanize object die on error. This is very convenient for quick development, later, if you want a robust program, you should disable that feature again.

... my $mech = WWW::Mechanize->new( autocheck => 1 ); # cookie jar and user agent are set implicitly