in reply to catch errors using Mechanize

snaporaz, here's the code I've used with WWW::Mechanize, without using eval
#!/usr/bin/env perl5.8.6 use strict; use warnings; use WWW::Mechanize; use WWW::Mechanize::FormFiller; my $mech = WWW::Mechanize->new(); my $formfiller = WWW::Mechanize::FormFiller->new(); ## Grab the home page, $mech->get("http://someurl"); my $msg= <<EOF; Couldn't get the xxxx portal. EOF #If not success, send mail and print the response output $mech->success or die send_mail("Subject: xxxx Portal down", $msg_b +os) , $mech->response->status_line; ## Store new HTML content in a temporary file and open it for viewing +. open (OUT,">/tmp/login.results"); print OUT $mech->content(); close (OUT); exit(0);
!!@!!
May the force be with you