When I run it, it produces the following:#!/usr/bin/perl use LWP::Parallel; use HTTP::Request; use LWP::Debug qw(+); my ($res); my $reqs=[ HTTP::Request->new('GET', 'http://www.somesite.com/index.html') ]; my $pua = LWP::Parallel::UserAgent->new(); $pua->max_hosts(15); $pua->max_req(15); $pua->in_order(1); foreach my $req (@$reqs) { my $a=$pua->register ($req); print "Registered: $req->url\n"; } my $entries = $pua->wait(); foreach (keys %$entries) { my $res = $entries->{$_}->response; my $content = $res->message; # not sure about previous line print $content; }
I tried to trace the call of http::Socket. It seems like I have problems with http.pm library or libnet (a part of LWP now). I have all needed libraries installed as far as I understand reading LWP's manual. And I have http.pm. If anyone ever had a problem like this, I'd like to here from him. Thanks a lot. I'm looking to hearing from you. My E-mail is nikos@hotbox.ru.LWP::UserAgent::new: () LWP::Parallel::UserAgent::max_hosts: (15) LWP::Parallel::UserAgent::max_req: (15) LWP::Parallel::UserAgent::in_order: (1) LWP::Parallel::UserAgent::register: (http://www.somesite.com/index.htm +l, [undef], [undef], [undef]) Registered: HTTP::Request=HASH(0x805780c)->url LWP::Parallel::UserAgent::wait: Current Server: 0 [ ] Pending Server: 1 LWP::Parallel::UserAgent::_make_connections_in_order: () LWP::Parallel::UserAgent::_check_bandwith: (LWP::Parallel::UserAgent:: +Entry=HASH(0x805b03c) [http://www.somesite.com/index.html] ) LWP::Parallel::UserAgent::on_connect: (http://www.somesite.com/index.h +tml) LWP::Parallel::UserAgent::_connect: (LWP::Parallel::UserAgent::Entry=H +ASH(0x805b03c) [http://www.somesite.com/index.html] ) LWP::Parallel::UserAgent::init_request: -> (HTTP::Request=HASH(0x80578 +0c)) [GET http://www.somesite.com/index.html] LWP::Parallel::UserAgent::init_request: GET http://www.somesite.com/in +dex.html LWP::UserAgent::_need_proxy: Not proxied LWP::Parallel::Protocol::implementor: Try autoloading LWP::Parallel::P +rotocol::http LWP::Parallel::UserAgent::init_request: <- (undef, [undef], LWP::Paral +lel::Protocol::http=HASH(0x805b168), 180, 1) LWP::Parallel::UserAgent::on_failure: (http://www.somesite.com/index.h +tml) Can't locate object method "new" via package "LWP::Parallel::Protocol: +:http::Socket".
In reply to LWP::Parallel Doesn't Work For Me by nikos
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |