Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: how to use find() options

by davido (Cardinal)
on Apr 17, 2024 at 16:57 UTC ( [id://11158918]=note: print w/replies, xml ) Need Help??


in reply to how to use find() options

find( { wanted => \&wanted_function, follow => ..., }, @directories );

It's there in the documentation; In the case of passing in an "options" hashref, the wanted function is one of the key/value pairs in that hashref.


Dave

Replies are listed 'Best First'.
Re^2: how to use find() options
by ypreisler (Novice) on Apr 18, 2024 at 16:50 UTC

    Hi Dave, thanks for the reply. i did not understand the "follow => ...," part. what should the "...," section include? thanks, Yaron.

      The SYNOPSIS section from the documentation for the module shows exactly how to do what you're asking in this thread, and shows an example of what follow should contain:

      Here's the third example in the SYNOPSIS section:

      use File::Find; find({ wanted => \&process, follow => 1 }, '.');

      Dave

        thanks a lot Dave, that solved my problem! :-)

      A true value if you want the option to take effect, a false value otherwise. See follow.


      🦛

        thanks a lot hippo, that clears things up! :-)

      What part of "there in the documentation" don't you understand? Learning to use documentation is an important part of learning to write code, or indeed doing many things in life.

      Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2025-12-09 08:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (88 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.