http://qs321.pair.com?node_id=28836

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I need to send a GET to a server, and while it is being processed I need to send another one.

Originally posted as a Categorized Question.

  • Comment on How do I process one GET while I send another one?

Replies are listed 'Best First'.
Re: How do I process one GET while I send another one?
by merlyn (Sage) on Aug 21, 2000 at 20:42 UTC
    If it's specifically about a "web" client (which you didn't require, but your example is one), use LWP::ParallelUserAgent.
Re: How do I process one GET while I send another one?
by zOrK (Initiate) on Jun 11, 2008 at 19:47 UTC
    you could use ParallelUserAgent. or you could try using threads.

    an example using threads could be something like:

    #!/usr/bin/perl use threads; my @urls = qw(http://www.perlmonks.org http://www.perlguru.org); foreach my $url (@urls) { my $thread = threads->new(\&getter, $url); $thread->detach; } sub getter { # well, here is supposed to be the get stuff #which would fetch a site + or whatever you'd like #to do. #} ## Code untested