in reply to IO::Select - reading multiple lines
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.# as a start change my $line = <$fh>; #to sysread $fh, my $line, 1024;,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: IO::Select - reading multiple lines
by Somni (Friar) on Jul 07, 2011 at 18:53 UTC | |
|
Re^2: IO::Select - reading multiple lines
by nagalenoj (Friar) on Jul 14, 2011 at 13:23 UTC | |
by zentara (Cardinal) on Jul 14, 2011 at 19:20 UTC | |
by nagalenoj (Friar) on Jul 15, 2011 at 12:16 UTC | |
by zentara (Cardinal) on Jul 15, 2011 at 12:23 UTC |