laziness, impatience, and hubris | |
PerlMonks |
Re^2: quickest way to find number of files in a directory?by jdporter (Paladin) |
on Mar 27, 2007 at 20:05 UTC ( [id://606862]=note: print w/replies, xml ) | Need Help?? |
++ to you. That's the way to go. I like let handles close automatically on block exit (where feasible) and since this snippet fits naturally in a sub, I'd do this:
It produces the number of files if called in scalar context and the list of filenames if called in list context.
A word spoken in Mind will reach its own level, in the objective world, by its own weight
In Section
Seekers of Perl Wisdom
|
|