Perl Recursive Mkdir


/ Published in: Perl
Save to your folder(s)



Copy this code and paste it in your HTML
  1. my @dirs = ();
  2. my @path = split /\//, '/foo/bar/baz/baz/bax/cat/dog';
  3. my $file = pop @path;
  4. map { push @dirs, $_; mkdir join('/', @dirs), 0777 } @path;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.