use strict; use warnings; use File::Find; my @found; my $target = '2012.avi'; my %options = (preprocess =>\&preprocess_dir, wanted =>\&wanted ); find( \%options, "C:/test"); sub preprocess_dir { my @avi_path=(); foreach my $this_name (@_) { return () if ($this_name =~ /\.ignore$/); # defer judgement if $target is found push @avi_path, ("$File::Find::dir/".$target) if $this_name =~ /$target/; } # ./ignore wasn't found push @found, @avi_path; return (); #Nothing for the wanted sub to do... } sub wanted {return();}; # nothing to do here # because list of files is always empty