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


in reply to Question about alternative to File::Find

you can pass a sub reference. this way you don't need a global variable. short example:
{ # somewhere in a block or sub my @files; find(sub { push @files, $_ }, $dir); }