Syntactic Confectionery Delight | |
PerlMonks |
Re: File::Find - Traverse the first level directories from starting point - How?by 1nickt (Canon) |
on May 19, 2020 at 02:11 UTC ( [id://11116921]=note: print w/replies, xml ) | Need Help?? |
Hi, welcome to the Monastery, That tutorial, while still probably valid, is almost 20 years old. File::Find is still the core Perl module, but there are modern wrappers to make life easier. See Path::Tiny which is modern Perl's basic file-handling tool, and which includes an iterator() method as well as a wrapper around that (visit()) which takes a callback to be executed on every file found. You didn't show an example of your File::Find code, but I'd rather steer you towards a modern tool anyway, so here's a demo:
For more complex file-finding use cases (which yours is not), see Path::Iterator::Rule by the same author. Hope this helps!
The way forward always starts with a minimal test.
In Section
Seekers of Perl Wisdom
|
|