I want to run a background program in a perl script. Ideally, it would be using IPC::Open3 or RPC::Run so I have access to STDOUT/STDIN/STDERR, but at this point I'll settle for any option which works.

Unfortunately, in some situations the program is interactive and prompts for user input. I don't have a regular prompt that I can watch for to signal that it's waiting input, and for this particular situation I'm not interested in the 'modify the program' answer, and since it takes variable amounts of time to run, I can't use a simple timer to see if it's stalled. What I really need to be able to do is to check the background program to see if it's stalled waiting for input (which isn't a trivial thing to determine I realize).

Does anyone know how to do this? A lot of googling and CPAN searching hasn't given me the answer, so I'm turning to you guys.

Thanks


In reply to Testing for a background process waiting for input by SBECK

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.