Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

merlyn (47)

merlyn
  merlyn@stonehenge.com
http://www.stonehenge.com/merlyn/
AOL IM: realmerlyn (Add Buddy, Send Message)
Yahoo! ID: realmerlyn (Add User, Send Message)

PAUSE-ID: MERLYN [cpan.org].
See my home page [stonehenge.com].

Journal of merlyn (47)

Wednesday October 06, 2004
07:12 PM

Updated File::Finder

[ #21223 ]
At the urge of brian d foy, I've updated my File::Finder to release File::Finder version 0.50 - we're halfway there!.

New features include better test coverage (found a bug while writing tests!) using Devel::Cover as an aid, and now better documentation on subclassing and extending the steps.

I've also included a TODO file of the remaining parts.

Here's the top of the manpage, in case you missed the previous announcements:

NAME
       File::Finder - nice wrapper for File::Find ala find(1)

SYNOPSIS
         use File::Finder;
         ## simulate "-type f"
         my $all_files = File::Finder->type('f');

         ## any rule can be extended:
         my $all_files_printer = $all_files->print;

         ## traditional use: generating "wanted" subroutines:
         use File::Find;
         find($all_files_printer, @starting_points);

         ## or, we can gather up the results immediately:
         my @results = $all_files->in(@starting_points);

         ## -depth and -follow are noted, but need a bit of help for find:
         my $deep_dirs = File::Finder->depth->type('d')->ls->exec('rmdir','{}');
         find($deep_dirs->as_options, @places);

DESCRIPTION
       "File::Find" is great, but constructing the "wanted" routine can some-
       times be a pain.  This module provides a "wanted"-writer, using syntax
       that is directly mappable to the find command's syntax.

       Also, I find myself (heh) frequently just wanting the list of names
       that match.  With "File::Find", I have to write a little accumulator,
       and then access that from a closure.  But with "File::Finder", I can
       turn the problem inside out.

       A "File::Finder" object contains a hash of "File::Find" options, and a
       series of steps that mimic find's predicates.  Initially, a
       "File::Finder" object has no steps.  Each step method clones the previ-
       ous object's options and steps, and then adds the new step, returning
       the new object.  In this manner, an object can be grown, step by step,
       by chaining method calls.  Furthermore, a partial sequence can be cre-
       ated and held, and used as the head of many different sequences.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.