my $line = <STDIN> || q{};
You introduced bugs by moving away from sysread.
First, you've introduced buffered IO. How can the select system call know that Perl has data waiting to be read in a buffer?
Second, you're blocking until a newline is received, and that could be an indefinitely long wait.
In reply to Re^2: Non-blocking I/O woes
by ikegami
in thread Non-blocking I/O woes
by dwalin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |