use File::Find; use strict; my @directory = ("\src"); 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) { find( sub {print "$_ target found\n" if -f and /\Q$srcfile\E/;}, 'D:\Projects\perl\targ'); }