# - [EX] Execution
#
+=item mkdir_p ( $base, @directory )
+
+Ensure that DIRECTORY (expressed as returned by File::Spec->splitdir)
+exists under the BASE directory.
+
+=cut
+
+sub mkdir_p {
+ # @_ is directory name elements
+
+ my @dir_steps; # list of intermediate dirs needed
+ # for example, creating bar/baz/quux in an empty /foo populates this list
+ # with qw( bar bar/baz bar/baz/quux )
+
+ for (@dir_steps = (); @_ && ! -d File::Spec->catdir(@_); pop)
+ { unshift @dir_steps, File::Spec->catdir(@_) }
+
+ mkdir $_ or die "mkdir($_): $!" for @dir_steps;
+}
+
sub archive {
my $dir = shift;
my $subdir = shift;