####START CODE my $location; my $user_cfg; #Define argument types GetOptions('location=s' => \$location, 'cfg=s' => \$user_cfg); # Process Command Line Arguments if ( @ARGV > 0 ) { #Check if cfg option was specified if ($user_cfg) { #Replace any spaces found in a "quoted" filename #i.e. ("sample test" --> "sample-test") if ($user_cfg =~ /\s/) { $user_cfg =~ s/\s+/-/g; } if (@ARGV) { foreach my $opt (@ARGV) { $user_cfg .= "-$opt"; } } } } print "location = $location\n"; print "cfg File = $user_cfg\n"; ### END CODE