At times getline will block when there is no new data
I'll repeat: No, it won't.
$ perl -le'$|=1; for (;;) { print "poke"; sleep 1; }' > file & perl -M +IO::Handle -e'sleep 3; print while $_ = STDIN->getline; print "exited + instead of blocking\n"' < file ; fg [1] 29483 poke poke poke poke exited instead of blocking perl -le'$|=1; for (;;) { print "poke"; sleep 1; }' > file ^C $ cat file ; rm file poke poke poke poke poke poke
In reply to Re^3: selecting from a number of different input sources.
by ikegami
in thread selecting from a number of different input sources.
by jasoncollins
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |