enter file name (you must specify the file name and press Enter) Test.file do you want to specify another file name (Y/N) (you must enter N in most cases and press Enter) N enter name for output file (you must specify a name for the output file, eg ttt and press Enter) Result.file reading Test.file; writing Result.file #### #! 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; my $progname = '/usr/local/bin/simpa96'; #--->this is the name of the external program I need to pass the parameters to 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;