in reply to IO::Socket leaves me hanging

Look at the subroutine 'request' in LWP::Protocol::http for details as to how to handle sockets. Here's a little test program you can debug to watch (from the LWP::UserAgent manpage):
# Create a user agent object use LWP::UserAgent; $ua = new LWP::UserAgent; $ua->agent("AgentName/0.1 " . $ua->agent); # Create a request my $req = new HTTP::Request GET => 'http://www.espn.com'; # Pass request to the user agent and get a response back my $res = $ua->request($req); # Check the outcome of the response if ($res->is_success) { print $res->content; } else { print "Bad luck this time\n"; }
Basically, they're using IO::Select to wait for data to become available, with a timeout.:
die "read timeout" if $timeout && !$sel->can_read($timeout); $n = $socket->sysread($buf, $size, length($buf));
where $sel is an IO::Select object.