c:\inetpub\test1 c:\inetpub\test2 c:\inetpub\test3 #### use File::Find; use File::Copy; my @directory = $all_directories; my @sourcefiles; my $srcfile; find(\&sourcefind, @directory); sub sourcefind { open(FL, $File::Find::name); push @sourcefiles, $_ if -f and /\.htm*/ ; close(FL); } foreach $srcfile (@sourcefiles) { copy( sub {print "$_ target found\n" if -f and /\Q$srcfile\E/;}, 'C:\temp'); }