in reply to Re^3: Stumped with select->can_read (buffered)
in thread Stumped with select->can_read
I tried doing that, but it didn't seem to work. My guess is that because one particular $fh is very busy, the while loop never ends?
This *seems* to work at the moment:
while(@ready = $sel->can_read)
foreach my $fh(@ready)
my $line = "";
sysread( $fh, $line, 1024 );
My concern now is whether 1024 is too small of a buffer that I could miss something (if that's possible), or missing a newline character because of the buffer size. Would it be horrible (performance wise) to read one byte at a time until I reach a newline character, thus forming a real $line?