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


in reply to Passing arguments to File::Find

I'm not too clear on what you mean...

If something takes a code ref as an argument, you can always pass more arguments in to the code ref by making a closure.

use strict; use File::Find; # make a closure that invokes &$arg2 on any filename that # ends in $arg1 sub makeExtClosure { my ($ext, $action) = @_; return sub { /$ext$/ && &$action; }; } find(makeExtClosure("pod", sub{print "$_\n"}), ".");
Is that what you had in mind?
--
Mike