#!/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 you use # modules to start the process for you. if ($? != 0) { if ($? & 127) { printf STDERR "abc died with signal %d\n", $? & 127 } else { printf STDERR "abc exited with error code %d\n", $? >> 8 } exit 1; }