in reply to Recursive file find and copy
There's still some confusion at the end there. If I understand your problem, I think you want this:
for my $dir ( @directories ) { find(\&process_directories, $dir); } sub process_directories { if ($File::Find::dir ne $dir) { $File::Find::prune = 1; return 0; } return 0 if ($_ !~ /\.rtf$/); copy($File::Find::name, "C:\\testfiles\\$_") or die "Failed to cop +y $_: $!\n"; return 1; }
|
|---|