Hi is there anyone out there who can help me with this
problem. I've an
associaitve array of urls to verify each links. I
know that this
particualr module is most efficient in that sense. I
tried to implement
it but somehow ironically, I have to wait very long.
I suspect that
I've done something wrong. Can someone please give
me advice on that?
Thanks.
Daniel
______________________________________________________
my ($count) = 0;
my (@reqs) = ();
foreach $url ( keys %ResultsArray) {
$reqs[$count] = HTTP::Request->new('GET',
$url);
$count++;
}
my $ua = LWP::Parallel::UserAgent->new();
$ua->in_order (0); # handle requests in order of
registration
$ua->duplicates(0); # ignore duplicates
$ua->timeout (5); # in seconds
$ua->redirect (0); # follow redirects
$ua->max_hosts (5); # sets maximum number of
locations accessed in
parallel
$ua->max_req (5); # sets maximum number of
parallel requests per
host
foreach my $req (@reqs) {
#print "Registering '".$req->url."'\n";
if ( my $res = $ua->register ($req) ) {
print STDERR $res->error_as_HTML;
}
}
my $entries = $ua->wait(5);
foreach (keys %$entries) {
my $res = $entries->{$_}->response;
print "Answer for '",$res->request->url, "' was
\t", $res->code,":
",
$res->message,"\n";
}
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com