use File::Path qw(make_path); make_path($dir);