in reply to Passing arguments to File::Find
I'm not too clear on what you mean...
--
Mike
If something takes a code ref as an argument, you can always pass more arguments in to the code ref by making a closure.
Is that what you had in mind?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"}), ".");
--
Mike
|
---|
In Section
Seekers of Perl Wisdom