You might try using IPC::Open3 or IPC::Open2 which are core perl modules and have the same gist as IPC::Run3.
If you only care about sending input to the shell script, which seems to be your intention, then you don't really need any of those modules. You can just use a piped open process. Piped processes have the disadvantage of only being able to read process output or send processes input, not both at once. Hence the need for the above modules. Sometimes that doesn't matter though...
#!/usr/bin/env perl
use warnings; # you forgot
use strict; # these two babies
open my $abc, '|-', '/oracle/pieces/abc.sh' or die "open: $!";
print $abc "y\n" for 1 .. 3;
close $abc or die "close: $!";
# You probably want to check to make sure abc did not fail, even if yo
+u use
# modules to start the process for you.
if ($? != 0) {
if ($? & 127) { printf STDERR "abc died with signal %d\n", $? & 12
+7 }
else { printf STDERR "abc exited with error code %d\n", $? >> 8 }
exit 1;
}
This will print the output of abc to STDOUT. If you don't want this, you can add a pipe to devnull (>/dev/null) after the command.
edit: After posting this I remembered there is also the unix "yes" command, which echoes "y" forever. You pipe its output to the program of choice. For example on the shell: yes | /oracle/pieces/abc.sh. Perl might be unnecessary unless your needs are more sophisticated.
another edit: I had 0x127 in the code instead of 127. Not good. |