Keep It Simple, Stupid | |
PerlMonks |
Re^2: selecting from a number of different input sources.by almut (Canon) |
on Jul 21, 2010 at 07:54 UTC ( [id://850566]=note: print w/replies, xml ) | Need Help?? |
... This worked for me. Really? It doesn't for me — at least not with the file handles being opened to regular text files. Buffering is only one of the problems here. The deeper issue is that with respect to select, regular disk files are defined to always be readable (even though the operation might block for a few milliseconds until the read head of the disk is positioned). In other words, if the file pointer is at the end of the file, select would still indicate that the file is readable. And because ->getline() reads until the next newline or eof, you could get partial lines (not terminated by a newline). So, while the following sort of works, it doesn't fulfill the OP's requirement to read entire lines.
It's effectively the same as
In Section
Seekers of Perl Wisdom
|
|