http://www.perlmonks.org?node_id=967141

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

I have an executable that I need to call from my Perl script. It is pretty simple when run from the command line:

~$:/path/executable "Here is the script. Please choose option 1 or 2" 1 "Thank you. Please provide the input file name:" myInputFile.txt (script runs and output file appears in the directory) ~$:

I can't figure out how to supply the requested information from within the Perl script.

#I have tried my $program = "path-to-executable"; system($program); #The script hangs here until I manually enter the re +quested info at the command line system("1"); system("myInputFile.txt"); #Have also tried my $program = "path-to-executable"; my $i = `$program`; #Script hangs here and nothing appears on the comm +and line at all $i = `1`; $i = `myInputFile.txt`;

I have even tried adding sleep() commands but that does not fix the problem. Is there a way to let my script know it needs to keep talking to the executable?