I believe LWP is used quite extensively in Perl applications and that it works quite reliably. I haven't had any reliability problems myself, though my experience is somewhat limited.
You certainly can submit multiple requests in a single invocation of the script. It should be as simple as calling the request method of the user agent multiple times with the same request.
The following is untested, but might give you some ideas. You would have to initialize $ua, $req, $niterations, $maxerrors and $sleeptime.
my $errorcount = 0; my @errors; for (1..$niterations) { my $res = $ua->request($req) unless($res->is_success) { $errorcount++; push(@errors, $res->status_line); } $errorcount++ unless($res->is_success); sleep($sleeptime); } die "ERRORS:\n\t" . join("\n\t", @errors) . "\n" if($errors > $maxerrors); exit(0);
Welcome to the Monastery and good luck learning Perl.
In reply to Re^5: LWP for URL monitoring - 500 connect timeout errors
by ig
in thread LWP for URL monitoring - 500 connect timeout errors
by oalvi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |