... if (@ARGV) { # test if there is at least one argument $basename = $ARGV[0]; # set basename to first argument } else { # otherwise be interactive print "Enter base name of input files\n"; chomp ($basename = ); } ...