One of the finest Perl (core!) module I’ve been using lately is File::Find. With File::Find it’s possible to traverse through a directory recursively to find anything you want from it. It comes with a number of options to alter the search behavior and a custom callback has to be supplied to determine what to do with the found file. Such as adding it to a list if it meets certain criteria, computing MD5 checksums or whatever else floats your boat.
Here’s a small example I also posted some time ago on Stack Overflow.
-
span class=”st0″>’.’‘..’‘/my/dir/to/search’
Zbigniew Lukasiak
August 22, 2010 at 01:28
Just in case that you wanted to try something else I would recommend that you tried some of the other File::Find::* modules at CPAN.
Htbaa
August 22, 2010 at 10:08
Ah thanks for the tip. I wasn’t aware of these.