my @newdirs = mkpath (blah blah blah) or die "mkpath failed: $!\n"; # you can now do something with @newdirs should you need to, such as print it out