#!/usr/local/bin/perl -W # force taint checks, and print warnings use strict; # install all three strictures use File::Copy; use File::Find; my $path = ""; #define full path to source folder my $newpath = ""; #define path to new folder my @Filenames; #recursively search $path for files opendir (ORIG , $path); @Filenames = readdir ORIG; closedir ORIG; $|++; # force output of buffer find (\&doCopy, $path); #Recursively search $path for files to copy sub doCopy { return if ! -f $File::Find::name; chdir($path) || die "cannot move to $path"; my $destFile = $newpath . $_; #print "\$destFile = $destFile\n"; copy( "$_" , "$destFile" ) or $path = $File::Find::dir ; #print "$_ cannot be copied $!. $File::Find::dir \n" ; }