use strict; use warnings; sub main { my $directory = "temp"; unless(-e $directory or mkdir $directory) { die "Unable to create $directory "; } } main();