![]() |
|
Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
How do you make File::Find a bit less ugly?by qazwart (Scribe) |
on Jun 13, 2006 at 16:13 UTC ( #555084=perlquestion: print w/replies, xml ) | Need Help?? |
qazwart has asked for the wisdom of the Perl Monks concerning the following question:
I'm not a big fan of File::Find. To use it, I usually create a wanted function, load up an array with the stuff I want, and then process the array in my main block of code:
To me, this just isn't very pretty because my @fileList array is being treated as being global to the &wanted funciton. Plus, it is slow because I have to wait for my array to fill up before I can use it. The way around this is to put most of my file processing code with in the wanted function which also seems just as ugly since 90% of my script will end up inside wanted. Maybe I really don't know the correct way to use File::Find. The Perl POD on this module concentrates more on find2perl than on using this module. However, it doesn't appear to be another method for File::Find. Just how are you suppose to use File::Find? Most of the comments I've seen concentrate on automatically generating the "wanted" array. To me, this really isn't the problem. Heck, I'd be happy if File::Find simply walked the file tree, and I had to manually take the output and figure out if I wanted it or not. Something like this: So, what is the best way to use Find::File?
Back to
Seekers of Perl Wisdom
|
|