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.


In reply to IO::BufferedSelect -does anybody use it / own it, Antal Novak? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.