shawn wilson wrote:
On Sun, Jun 12, 2011 at 14:38, Brian F. Yulga<byu...@langly.dyndns.org>  wrote:

perl -MFile::Find -wle "find( sub{ /\.mp3$/i and print;}, q(.));"

just curious, what's the difference (in speed or results) between this
and 'dis/a/s/b *.mp3'?
obviously File::Find and perl are more powerful, but that doesn't seem
like the right use case for it?

Hi Shawn,

Good point... For a simple printing of results, 'dir' is noticeably faster and gives the same results. Actually, before I learned how to use File::Find, I used to pipe the output from 'dir' to perl to filter results with a regex:

dir /s /b | perl -wnle "/regex/ and print;"

...essentially using perl as 'grep', and it's faster than the File::Find solution (well, I don't have benchmarks to prove it, but File::Find seemed slower to me). Although in my rather basic uses, the performance difference is inconsequential, and either way beats using the Windows "Search Companion".

\Brian

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to