my $default_dir = "C:/Main/work"; if (@ARGV == 1) { $default_dir = shift @ARGV ) elsif (@ARGV >1) { die "too many command line args\n"; }; # $default_dir remains in effect if there was not # exactly one command line argument