I don't know the answer to your question. But there are a few things I would check if I had your problem.

First: do you need to delay before passing the password (as suggested above)? ie. after opening your process put your process to sleep(5); to give your subprogram time to start up and ask the password question?

Secondly: some programs, like passwd on linux, use tricks to ensure you can't just pass input via STDIN - this is to prevent nasty hacks that bypass security. To get around this a language called TCL/Expect is commonly used for applications that need to call passwd (the trick used is to log in again and execute the program through a login shell). That is why I suggested a Perl-equivalent, Expect. It is possible that the program you're using needs special handling like the linux passwd program.


In reply to Re^3: passing in User Input by monarch
in thread passing in User Input by slloyd

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.