use File::Find; my $ignore = '(?:\.exe|\.doc)$'; find(\&consider, $root); emit_report(); sub consider { my $path = $File::Find::path; return if $path =~ m/$ignore/o; process($path); }