use strict; use File::Find; find({ preprocess => \&preprocess, wanted => \&wanted, }, "."); # munge data so wanted() gets the desired input sub preprocess { my @files = @_; ... } sub wanted { ... }