use File::Path ; my $dir = 'D:\Temp\ExpImpTest2\Declan test2\here\Logs' ; $dir =~ s/\\/\//g ; mkpath ($dir) || die "Cannot create $dir: $!" ;