Here is an efficient way to do it. We make each dir exactly once and do it in the file find sub so there is no reprocessing.
sub clone_dir_tree { my ( $from, $to ) = @_; require File::Find; File::Find::find ( sub { return unless -d $File::Find::name; $File::Find::name =~ m/^\Q$from\E(.*)$/; mkdir "$to/$1"; }, $from ); }
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In reply to Re: cloning a directory tree
by tachyon
in thread cloning a directory tree
by zentara
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |