use strict; use warnings; die "Please supply an argument to the program" if @ARGV < 1; my $dir = shift; die "Please try again with a valid directory.\n" unless -d $dir; # Change to user selected location chdir $dir; mkdir "FirstSubDir"; mkdir "SecondSubDir";