in reply to What's the best way to use $mech->success?
$ua->click; die "I'm failing ", $ua->reload unless $ua->success; sleep 15;
What are you up to with that? It looks to me like the script will die (or "crash" as you put it) the first time that $ua->success fails to return true. Is that what you want? From your description it sounds like what you want is something more like
while ($ua->response->content =~ m/nextbut/i) { until ( $ua->click->is_success ) { warn "Submission failed: I'll sleep for a while"; sleep 15; $ua->reload; } # etc., etc. }
the lowliest monk
|
|---|