after some searching i have not found an easy solution to the problem of timed-out, line-buffered reads of filehandles. I often use open3 to run subprocesses and read their output via the pipe filehandle. The easiest thing to do is <OUT> but that does not timeout, and subprocesses can hang. And <OUT> is a blocking read. So i want an <OUT> with a timeout. I could alarm, but that's an interruption and i can't return to the original code stream containing the <OUT>. The man perl answer from IO::Open3 is to use select(,,,$timeout) and then sysread which is fine, but it is not line buffered. One can find the newlines and parse oneself, but that's a chore. That's what CPAN is for, right?
So i did find IO::BufferedSelect which is the exact answer i'm looking for, but it has a bug, which i reported and fixed.
but i'm having trouble contacting the author, Antal Novak. His cpan.org acct which forwards to standford.edu is no more ("User unknown in virtual alias table").
What i'm mostly asking is how other people deal with timed-out, buffered reads. And if anyone has used this exact module. I understand you have to go to PAUSE if someone wants to take over an abandoned module.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |