in reply to Re^3: Non-blocking I/O woes
in thread Non-blocking I/O woes
The bug doesn't happen because perl has STDIN line-buffered. Select won't notice STDIN has read data until you press enter. This also means there will always be a newline to read for <STDIN>.
Line-buffering only makes sense for output handles, and STDIN is not an output handle.
Secondly, you don't only use readline (<>) on STDIN.
See Re^3: Malfunctioning select() call on a FIFO for a demonstration of the problem.
It is my hypothesis that the buffer you speak of happens at the system level and not inside the perl interpreter.
Sometimes, yes. Not always.
I have no idea how this works in windows.
Not very well, since select only works on sockets in Windows.
|
|---|