|
|
| Keep It Simple, Stupid | |
| PerlMonks |
Re: Reading non-blockingly / "awk has to be better for something."by james2vegas (Hermit) |
| on Jul 28, 2012 at 08:49 UTC ( #984161=note: print w/ replies, xml ) | Need Help?? |
|
Yes there is, set your $fh non-blocking (IO::Handle's blocking method) and use IO::Handle's getline method on $fh, bearing in mind that getline will return undef (ending a while loop) when there isn't a line to read (<$fh> would also work non-blockingly, so getline is not strictly necessary)
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||