in reply to Async HTTP Request
You start the get request asynchronouslyand then fall off the end of the script before it has completed,hence the error.
Try waiting for the response:
use HTTP::Async; use HTTP::Request; my $async = HTTP::Async->new; $async->add( HTTP::Request->new( GET => 'http://www.perl.org/' ) ); my $response = $async->wait_for_next_response;
Of course, unless you add several gets, that is the same as doing a synchronous get, but it will 'fix' the error.
|
|---|