use File::Finder; File::Finder->type('f')->eval(sub { your sub here })->in(@starting_points);