Thanks four your reply. After adding your changes to my script, I noticed that READ and ERROR do not have any data at all. This is weird because soon after I execute the binary (from a command line) it prompts with a list of choices to choose from. My suspicion is that the binary only sends out data if its STDOUT is connected to a terminal. I am not sure if open3 provides any connection to a terminal..
I tried the write at the beginning of the program (as above) but neither of $answer or $error was populated.
The pipe method you mention is what I've been using until now. I wanted to add more error checking by examining the choices the program gives the user before writing data back to its STDIN.
Thanks for your time!
In reply to Re^4: Executing command from perl script with input/output
by linuxfan
in thread Executing command from perl script with input/output
by linuxfan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |