http://qs321.pair.com?node_id=221797


in reply to Value Fill

The Expect module mentioned above is the usually best approach for working with interactive processes. It is well designed for dealing with interactive processes, handling deadlocks and situations where you have some input that is expected, an unexpected error, or nothing at all returns.

Another way to work with interactive processes is IPC::Open2. Using IPC::Open2 will give you a read and a write handle to a process. It should be included as a standard module, so it does not require installing a new module. But using it can degenerate quickly if you get unexpected errors or no output from a program, so you need to program carefully to avoid deadlocks. I would recommend you use Expect if at all possible.