Even if select could see the contents of the buffers (which it sometimes does, I believe), you still couldn't use readline (<$fh>).
I listed two conditions that make sysread suitable. Its non-buffering aspect was just one of them. The other is that it returns as soon as there's data available, so it doesn't block. readline, on the other hand, blocks.
What makes sysread complicated, the use of buffers, is the result of it's non-blocking nature. Its non-blocking nature is the reason you want to use it. If readline was non-blocking, you'd have to jump through the same hoops.
select is inherently complicated. Imagine if you had both readers and writers! Again, if you want simplicity, you want threads.
In reply to Re^3: select() and input buffering
by ikegami
in thread select() and input buffering
by declan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |