There's more than one way to do things | |
PerlMonks |
Re^2: Reading partial lines/strings from a pipeby slightly72 (Initiate) |
on Oct 10, 2007 at 18:24 UTC ( [id://644058]=note: print w/replies, xml ) | Need Help?? |
Phil, thank you very much for the pointer and the book reference, it got me in the right direction. The final solution is almost like the one you suggested:
$rdr->read is just an OO wrapper for read. The key to making this work was to use $rdr->blocking(0), which makes the pipe reading non-blocking. Otherwise a deadlock occurs -- maybe because the read command blocks while waiting for 1k to be filled, but not sure. Thank you,
In Section
Seekers of Perl Wisdom
|
|