#! perl -slw use strict; print "enter file name (you must specify the file name and press Enter)"; chomp( my $infile = ); print "do you want to specify another file name (Y/N) (you must enter N in most cases and press Enter)"; chomp( my $another = ); print "enter name for output file (you must specify a name for the output file, eg ttt and press Enter)"; chomp( my $outfile = ); print "reading $infile; writing $outfile"; exit 99; #### #! perl -slw use strict; my $progname = 'junk33'; my $pid = open CMD, '|-', $progname or die $!; print CMD 'myInfile'; print CMD 'N'; print CMD 'myOutfile'; close CMD; waitpid $pid, 0; print "$progname ended: status: ", $? >>8; #### c:\test>junk32 enter file name (you must specify the file name and press Enter) do you want to specify another file name (Y/N) (you must enter N in most cases and press Enter) enter name for output file (you must specify a name for the output file, eg ttt and press Enter) reading myInfile; writing myOutfile junk33 ended: status: 99