Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 0f5690b32f95d575eb58449219bc1e30 > files > 59

perl-Coro-6.310.0-2.mga4.x86_64.rpm

#!/usr/bin/perl

use Coro::LWP; # should be use'd as early as possible

use Coro;
use Coro::AnyEvent;
use LWP::Simple;

$SIG{PIPE} = 'IGNORE';

my @pids;

for (1..1) {
   push @pid, async {
      print "starting to fetch http://www.google.de/\n";
      get "http://www.google.de/";
      print "fetched http://www.google.de/\n";
   };

   push @pid, async {
      print "starting to fetch http://www.yahoo.com/\n";
      get "http://www.yahoo.com/";
      print "fetched http://www.yahoo.com/\n";
   };
}

$_->join for @pid;