http://www.perlmonks.org?node_id=584720


in reply to regarding File::Find

The following code uses the list as a buffer. The wanted method adds the value to the buffer and only saves the buffer if it has a reached a certain length.
#! /usr/bin/perl -w use strict; use Data::Dumper; use File::Find; my @search_result; find (\&wanted,"."); save_data(); sub wanted { return unless /\.pl$/i; push @search_result,$File::Find::name; if (@search_result == 10) { # save buffer and empty if 10 results save_data(@search_result); @search_result = (); } } # stubbed! sub save_data { print join(',',@search_result),"\n"; }