use File::Spec::Functions qw/catdir/; use File::Path qw/make_path/; make_path(catdir('folderA','folderB','folderC')); # Update 2: OR: use Path::Class qw/dir/; dir('folderA','folderB','folderC')->mkpath;