--- Coro/eg/lwp 2007/04/14 15:06:06 1.6 +++ Coro/eg/lwp 2008/11/24 04:56:38 1.8 @@ -1,7 +1,7 @@ #!/usr/bin/perl use Coro; -use Coro::Event; +use Coro::AnyEvent; use Coro::LWP; # should be use'd as early as possible use LWP::Simple; @@ -9,17 +9,19 @@ my @pids; -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"; -}; +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;