Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: (Buzzcutbuddha - Quick Overview of File::Find Syntax) - File Find

by buzzcutbuddha (Chaplain)
on Jan 16, 2002 at 18:34 UTC ( [id://139206]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: (Buzzcutbuddha - Further Help) - File Find
in thread File Find

From the File::Find doc pages: The first argument to find() is either a hash reference describing the operations to be performed for each file, or a code reference.

wanted: The value should be a code reference. This code reference is called the wanted() function below.

no_chdir: The script does not change each directory as it recurses.

What that basically means is if you only want to pass the code reference, you can just pass if, as you did in your first script. However, if you want to add any parameters to your call of File::Find (all of which are explained in the doc pages), you need to construct an anonymous hash:
{wanted => \&coderef, parameter => 'value'}

This is a common way of passing named parameters into functions.

hth.

  • Comment on Re: (Buzzcutbuddha - Quick Overview of File::Find Syntax) - File Find
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-04-19 18:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found