in reply to Perl API that emulates mkdir -p on unix?

Might be a little heavier that you want, but File::Flat also does this, or rather it lets you just write a file somewhere and it sorts all the details out for you.
File::Flat->write( '/some/path/that/might/exist.txt', $contents );
Of course, the neatest thing is that this...
File::Flat->canWrite( '/some/path/that/might/exist.txt' );
... also "means what you think", that is, "Can I write to the file, or create the file, or create as many directories as are needed".

Great for writing installer-type applications.