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