I don’t see the find2perl documentation mentioning anything about support for -mindepth and -maxdepth arguments.
The example below works fine with find:
$ find2perl . -mindepth 2 -maxdepth 2 -name "*txt" -type f
Unrecognized switch: -mindepth
Questions:
- Does
find2perlsupport such functionality? - If so, how can I specify
mindepthandmaxdepth?
File::Find::Rule has these options, and it has a command line program findrule.
If you want to do it with File::Find, you can implement maxdepth by checking the depth of the file and setting
$File::Find::prunewhen you’ve gone too deep. mindepth is similar, but you return from your function early. I’m feeling lazy this morning, so I’ll leave the coding to someone else.UPDATE: Somebody else did the programming, namely File::Find::Rule. Here’s the code they use.