In unix there is a -p tag for the mkdir command. Is there a similar tag in Perl?

I don't think so, but it's real easy to shell to the prompt, and mkdir -p that way, such as:

system "mkdir -p whatever";

or you can just use ticks `mkdir -p whatever`; Hope this helps.

mkpath (part of the standard perl modules) does what you want:

use File::Path;
mkpath "foo/bar/"; #will create foo before bar if needed :)