in reply to cloning a directory tree

Take a look at File::Flat, File::List and File::Spec. These provide friendly ways to manipulate directories and files.

This example clones a directory tree:

use File::Flat; use File::List; my $search = new File::List("/usr/local/man"); $search->show_only_dirs(); my @dirs = @{ $search->find(".*") }; foreach my $dirname (@dirs){ File::Flat->makeDirectory("/copy".$dirname); }
Of course, this code could be tightened up quite a bit.

It should work perfectly the first time! - toma