in reply to adding a variable definition to execution

use strict; # DON'T FORGET TO use warnings; # DO THESE! # the shift is implicitly acting on @ARGV. my $base_name = shift; unless ( $base_name ) { print "Enter base name of input files: "; chomp ( $base_name = <STDIN> ); } # die() or retry a read from <STDIN> if there # is no $base_name at this point. # Then check to see if $base_name has a valid value. # Continue on. Happy Perl!