I'm trying to get LWP::Parallel::UserAgent to work with perlapp or perl2exe on WinXP. When script below is runned from command-console, everything works fine.

Once the script gets "compiled" with perlapp or perl2exe, the script just refuses to connect and bring home any data..

Below is some of the output from the test script when runned with "use debug"-option on and compiled with perlapp:

LWP::UserAgent::new: () LWP::Parallel::UserAgent::register: (http://www.cnn.com, CODE(0xd91f90 +), [undef] , [undef]) LWP::Parallel::UserAgent::register: (http://www.sun.com, CODE(0xd91f90 +), [undef] , [undef]) LWP::Parallel::UserAgent::register: (http://www.msn.com, CODE(0xd91f90 +), [undef] , [undef]) LWP::Parallel::UserAgent::register: (http://www.sun.com, CODE(0xd91f90 +), [undef] , [undef]) LWP::Parallel::UserAgent::register: (http://www.bbc.co.uk, CODE(0xd91f +90), [unde f], [undef]) LWP::Parallel::UserAgent::wait: Current Server: 0 [ ] Pending Server: 4 [ www.msn.com:80, 1, www.cnn.com:80, 1, www. +sun.com:80 , 2, www.bbc.co.uk:80, 1 ] LWP::Parallel::UserAgent::_make_connections_unordered: () LWP::Parallel::UserAgent::_check_bandwith: (LWP::Parallel::UserAgent:: +Entry=HASH (0xe114a4) [http://www.msn.com] ) LWP::Parallel::UserAgent::on_connect: (http://www.msn.com) LWP::Parallel::UserAgent::_connect: (LWP::Parallel::UserAgent::Entry=H +ASH(0xe114 a4) [http://www.msn.com] ) LWP::Parallel::UserAgent::init_request: -> (HTTP::Request=HASH(0xe0f96 +0)) [GET h ttp://www.msn.com] LWP::Parallel::UserAgent::init_request: GET http://www.msn.com LWP::UserAgent::_need_proxy: Not proxied LWP::Parallel::UserAgent::on_failure: (http://www.msn.com) LWP::Parallel::UserAgent::_check_bandwith: Failed connection for 'www. +msn.com:80 ' LWP::Parallel::UserAgent::_make_connections_unordered: Queue for www.m +sn.com:80 contains 0 pending connections LWP::Parallel::UserAgent::_check_bandwith: (LWP::Parallel::UserAgent:: +Entry=HASH (0xe0f768) [http://www.cnn.com] ) LWP::Parallel::UserAgent::on_connect: (http://www.cnn.com) LWP::Parallel::UserAgent::_connect: (LWP::Parallel::UserAgent::Entry=H +ASH(0xe0f7 68) [http://www.cnn.com] ) LWP::Parallel::UserAgent::init_request: -> (HTTP::Request=HASH(0xa0c23 +c)) [GET h ttp://www.cnn.com] LWP::Parallel::UserAgent::init_request: GET http://www.cnn.com LWP::UserAgent::_need_proxy: Not proxied LWP::Parallel::UserAgent::on_failure: (http://www.cnn.com) LWP::Parallel::UserAgent::_check_bandwith: Failed connection for 'www. +cnn.com:80 ' LWP::Parallel::UserAgent::_make_connections_unordered: Queue for www.c +nn.com:80 contains 0 pending connections LWP::Parallel::UserAgent::_check_bandwith: (LWP::Parallel::UserAgent:: +Entry=HASH (0xe0fa08) [http://www.sun.com] ) LWP::Parallel::UserAgent::on_connect: (http://www.sun.com) LWP::Parallel::UserAgent::_connect: (LWP::Parallel::UserAgent::Entry=H +ASH(0xe0fa 08) [http://www.sun.com] ) LWP::Parallel::UserAgent::init_request: -> (HTTP::Request=HASH(0xe0f6b +4)) [GET h ttp://www.sun.com] LWP::Parallel::UserAgent::init_request: GET http://www.sun.com LWP::UserAgent::_need_proxy: Not proxied LWP::Parallel::UserAgent::on_failure: (http://www.sun.com) LWP::Parallel::UserAgent::_check_bandwith: Failed connection for 'www. +sun.com:80 ' LWP::Parallel::UserAgent::_check_bandwith: (LWP::Parallel::UserAgent:: +Entry=HASH (0xe11624) [http://www.sun.com] ) LWP::Parallel::UserAgent::on_connect: (http://www.sun.com) LWP::Parallel::UserAgent::_connect: (LWP::Parallel::UserAgent::Entry=H +ASH(0xe116 24) [http://www.sun.com] ) LWP::Parallel::UserAgent::init_request: -> (HTTP::Request=HASH(0xe113f +c)) [GET h ttp://www.sun.com] LWP::Parallel::UserAgent::init_request: GET http://www.sun.com LWP::UserAgent::_need_proxy: Not proxied LWP::Parallel::UserAgent::on_failure: (http://www.sun.com) LWP::Parallel::UserAgent::_check_bandwith: Failed connection for 'www. +sun.com:80 ' LWP::Parallel::UserAgent::_make_connections_unordered: Queue for www.s +un.com:80 contains 0 pending connections .... ....
The test-script:
use strict; use LWP::Parallel::UserAgent; #Turns on debug mode _ outputs lot of info.. use LWP::Debug qw(+); $|++; my @sites = qw ( http://www.cnn.com http://www.sun.com http://www.msn.com http://www.sun.com http://www.bbc.co.uk ); my $totalbytes = 0; my $pua = LWP::Parallel::UserAgent->new(); #Build requests foreach (@sites) { my $req = HTTP::Request->new('GET',$_); $pua->register($req, \&Callback); } #Initiate request $pua->wait(); printf "\n\nTotalbytes read:%.2f KB", $totalbytes/1024; sub Callback { my ($data, $response, $protocol) = @_; $totalbytes += length $data; print "\nGot ",length $data," bytes of data from ", $response->bas +e; }
Any ideas?

Thanks.


In reply to Using LWP::Parallel::UserAgent with perlapp/perl2exe by ldln

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.