miriamherald has asked for the wisdom of the Perl Monks concerning the following question:
Any tips on what I can do so that it doesn't 'die' if there is an error. I had though that the code above would be enough but apparently it's not. Thank you in advance.my $m = WWW::Mechanize->new( autocheck=>1); $m->get($url); if ($m->success) { $m->submit_form( form_id => 'comment-form', fields => { author => $author, email => $email, url => '', text => $comment, }, ); my $response = $m->response(); print "Your comment has been posted and will appear shortly."; } else { print "Was not able to connect to website."; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Perl Mechanize script dies during success check
by philipbailey (Curate) on Mar 26, 2010 at 19:14 UTC | |
Re: Perl Mechanize script dies during success check
by crashtest (Curate) on Mar 26, 2010 at 19:57 UTC |