in reply to copy directory

I don't think I even totally understand your question, but if I do, this is how I would sort of quickly approach it. It's not beautiful, but it works.
  -A
my $container = '/path/to/dir/that/holds/all/the/dirs'; my $tomove = '/path/to/the/dir/you/want/to/move'; my $newdir; chomp($newdir = `ls -1 $container | tail -n 1`); $newdir++; system("mv $tomove $container/$newdir");
Edit: I just noticed you want to copy instead of move - in that case, just replace the last line with system("cp -r $tomove $container/$newdir");

--
By a scallop's forelocks!