mkdir("c:\\automation") or die("Unable to create automation directory: $!\n"); #### use File::Path qw( mkpath ); eval { mkpath("c:\\nonexistant\\automation"); }; if ($@) { die("Unable to create automation directory: $@\n"); }