in reply to Re: Pre-empting STDIN during Testing
in thread Pre-empting STDIN during Testing

I did look at Expect.pm. I suppose my immediate reaction was: "This is immense. Which one of these dozens of functions could be the one I need?" In other words, the learning curve I would face for Expect seemed much greater than what I thought was needed for the task at hand. So I passed on it, but will definitely keep it in mind for similar projects in the future.

Thanks for responding.

jimk

Replies are listed 'Best First'.
Re^3: Pre-empting STDIN during Testing
by dragonchild (Archbishop) on Feb 15, 2005 at 20:11 UTC
    You'll want to start with Expect::Simple. And, frankly, you can start with the following methods and probably never need more:
    • send() - this is what you use to interact with STDIN
    • before() - this is what the prompt was that you just sent stuff to with send()
    • after() - this is what the program blabs to you after you send the stuff with send()

    If you need more, then more reading is the thing to do. Note: As you've found out, interacting with STDIN is hard. Don't complain if you have to read for a few hours to have someone else take all the craziness out of it for you.

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.