Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: File::Find

by RMGir (Prior)
on Apr 10, 2002 at 18:22 UTC ( #158099=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://158099]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2020-10-28 20:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (264 votes). Check out past polls.

    Notices?