Tutorials -> How to RTFM
| MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!" | | I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README). | | ** The third rule of perl club is a statement of fact: pod is sexy. |
| [reply] |
As I prefer functional style programming over procedural, I never really liked File::Find's "global vars interface".
So being faced with the problem of looking through some directory tree i will use File::Find, but when it's necessary to tweak the process of its search, I prefer using the preprocess CODEref.
As I don't see that covered a lot in the resources given by PodMaster, I'd like to give an (overly explicit) example:
An additional advantage of this approach over using/setting File::Find::prune, is that it also works with bydepth => 1.
Also note, that I generally refuse to let find do the chdir thing, because that tends to confuse me. ;-)
Just my two eurocent | [reply] [d/l] [select] |
As I prefer functional style programming over procedural, I never really liked File::Find's "global vars interface"
That's kind of funny. File::Find has one of the most functional interfaces of any core module I can think of. I mean, its 'find' subroutine's first argument is a function. Granted, it does use funky globals instead of @_ to pass arguments to that function, but I think that's an orthogonal to its functional-ness.
| [reply] |
| [reply] [d/l] [select] |