use AnyEvent::Loop; use AnyEvent::HTTP; http_get 'http://yahoo.com', sub { my ($body, $hdr) = @_; die $hdr->{URL} }; AnyEvent::Loop::run; #### use AnyEvent::Loop; use AnyEvent::HTTP; use feature 'say'; for my $url ('yahoo.com', 'google.com') { http_get "http://$url", sub { say STDERR $url }; } AnyEvent::Loop::run;