http://www.perlmonks.org?node_id=913167


in reply to IO::Select - reading multiple lines

You might want to use sysread instead of my $data = <$fh>. See sysread and syswrite in tcp sockets for example.
# as a start change my $line = <$fh>; #to sysread $fh, my $line, 1024;,
The basic issue is that <$fh> does a buffered read from the socket. It won't return from the read call until $/ (defaults to "\n") is encountered on the channel. IO::Select::can_read just means that there is data on the channel, it does not necessarily mean that there is a full record (defined as: a chunk terminated with an occurence of $/) waiting on the channel.

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh