my @found; find(sub { push @found, $File::Find::name; }, @directories); for (@found) { next if !check($_); ... }