Seems some people need an explanation for why it is dumb.

If you prefer to use an event driven method for performing the OPs task, there is absolutely no logic in installing a 270 module "real time web framework" (nor even a 150+ module POE) to do it.

When LWP::ParallelUA will do the job with just 9 files:

#! perl -slw use strict; use LWP::Parallel::UserAgent; use Time::HiRes qw[ time ]; sub lookup { my( $lookup, $resp, $prot ) = @_; my( $name ) = ${ $resp->{ _request }{ _uri } } =~ m[&user=([^&]+)& +]; print "Response for $name"; if( $lookup =~ m/gain:Overall:\d+:(\d+)/isg ) { print "$name $1"; } elsif( $lookup =~ m/(ERROR)/isg ) { print "$name doesn't exist " } else{ print "$name 0"; } } my @names = do{ local @ARGV = 'firstnames.txt'; <>}; #qw(zezima fred b +ill john jack); chomp @names; my $start = time; my $pua = LWP::Parallel::UserAgent->new(); $pua->timeout( 10 ); $pua->max_req( $ARGV[ 0 ] // 10 ); $pua->register( HTTP::Request->new( 'GET', "http://rscript.org/lookup.php?type=track&time=62899200&user=$ +{_}&skill=all" ), \&lookup ) for @names; my $entries = $pua->wait; warn time - $start; __END__ c:\test>PUA-getnames >nul 91.8953080177307 at C:\test\PUA-getnames.pl line 44, <> line 501. c:\test>PUA-getnames 20 >nul 82.6376140117645 at C:\test\PUA-getnames.pl line 44, <> line 501.

S'no quicker than threads and not that much smaller, but it does at least work!


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?


In reply to Re^10: Consumes memory then crashs by BrowserUk
in thread Consumes memory then crashs by allhellno

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.