use strict; use File::Path; my $directory = '/tmp/some/path'; mkpath($directory);