Petruchio has asked for the wisdom of the Perl Monks concerning the following question:

I'd like to be able to take control of interactive programs, and run them with a script. If system(), for instance, returned filehandles for the stdin, stdout and stderr of the spawned process, for instance, it'd be perfect.

Of course, you could do something kludgey with sockets or curses, but that's not much fun. Perhaps I'm overlooking the obvious (which I've done before); any ideas?

Replies are listed 'Best First'.
Re: sorta like system()
by Anonymous Monk on Feb 17, 2000 at 21:42 UTC

    perldoc IPC::Open3

    exactly what you are looking for...
    BUT for a more high-level and easy approach, you can try the Expect module from CPAN

      Excellent... that'll do. Thanks.