I would just pipe the interaction sequence from STDIN into the program, and capture the whole STDOUT in one go, and at the end compare whether the interaction was as expected. Most likely IPC::Run is the nicest thing to supply a child process with input and capture its output. I would try to stay away from true interactivity. Just push in a preset sequence of strings and only when the program has stopped, look at the generated output. alarm should be used as a safeguard so no runaway child can stop your whole test suite.