in reply to File::Find managing the %options versus \&wanted dichotomy

You put the \&wanted into the options hash. Example from documentation:

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

Note also that \&wanted can return 0 to prune the tree (prevent processing sub dirs below the current one).


Perl is Huffman encoded by design.

Replies are listed 'Best First'.
Re^2: File::Find managing the %options versus \&wanted dichotomy
by anonymized user 468275 (Curate) on Aug 17, 2005 at 11:41 UTC
    Thanks - the wanted in the options hash solves the (false) dichotomy nicely.

    However, the return of 0 to prune the tree won't work because, for example, lost+found (an example included in the OP) is immediately below the mount point of its device - so that would mean pruning everything except the top directory, to take an extreme example of that approach.

    One world, one people