Sorry, but I think that's rather doubtful. The suggestions above that use readdir or globs are really quite simple and compact, in addition to being very direct and easy to comprehend.
The calling and callback mechanisms for File::Find, in contrast, are relatively Byzantine -- obscure and fraught with traps for the unwary and uninitiated. (Much more study and learning is needed to use File::Find at all, let alone use it effectively.) Not only that, but File::Find tends to consume more run-time than other approaches. It has it's uses, but I don't think this is one of them.
Speaking of reducing run-time, when adopting one of the glob or readdir approaches above, I'd put the regex match before the "-f" test, since doing a stat on every file will take a little extra time, compared to stat'ing just the ones that match the file name pattern.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.