in reply to file input from command line

Further to John's answer, Getopt::Std may be of use to you. I pass options in as follows:
use strict; use Getopt::Std; my $USAGE="USAGE: sample.pl -f <infile1> -i <infile2> -o <outfile>"; my %Options; getopts('f:i:o:', \%aOptions); my $infile1= $aOptions{f} || die "** $USAGE.\nERROR missing input file +1 ** "; my $infile2= $aOptions{i} || die "** $USAGE.\nERROR missing input file +2 ** "; my $outfile= $aOptions{o} || die "** $USAGE.\nERROR missing output fil +e ** ";