… | |
… | |
5 | use Coro::LWP; # should be use'd as early as possible |
5 | use Coro::LWP; # should be use'd as early as possible |
6 | use LWP::Simple; |
6 | use LWP::Simple; |
7 | |
7 | |
8 | $SIG{PIPE} = 'IGNORE'; |
8 | $SIG{PIPE} = 'IGNORE'; |
9 | |
9 | |
10 | async { |
10 | my @pids; |
11 | print "hi2\n"; |
11 | |
|
|
12 | push @pid, async { |
|
|
13 | print "starting to fetch http://www.google.de/\n"; |
12 | get "http://www.google.de/"; |
14 | get "http://www.google.de/"; |
13 | print "ho2\n"; |
15 | print "fetched http://www.google.de/\n"; |
14 | }; |
16 | }; |
15 | |
17 | |
16 | async { |
18 | push @pid, async { |
17 | print "hi\n"; |
19 | print "starting to fetch http://www.yahoo.com/\n"; |
18 | get "http://www.yahoo.com/"; |
20 | get "http://www.yahoo.com/"; |
19 | print "ho\n"; |
21 | print "fetched http://www.yahoo.com/\n"; |
20 | |
|
|
21 | }; |
22 | }; |
22 | |
23 | |
23 | loop; |
24 | $_->join for @pid; |
24 | |
25 | |