File::Find::Rule - Alternative interface to File::Find
use File::Find::Rule; # find all the subdirectories of a given directory my @subdirs = File::Find::Rule->directory->in( $directory ); # find all the .pm files in @INC my @files = File::Find::Rule->file() ->name( '*.pm' ) ->in( @INC ); # as above, but without method chaining my $rule = File::Find::Rule->new; $rule->file; $rule->name( '*.pm' ); my @files = $rule->in( @INC );
This module has external dependencies on the following modules:
Cwd File::Find File::Spec Number::Compare Test::More Text::Glob
perl Build.PL perl Build test
and if all goes well
perl Build install
What changed over the last 3 revisions
- MANIFEST fixes (thanks to the cpan smokers)
- split the documentation of the procedural interface out to File::Find::Rule::Procedural, as people often seem to get confused that the method calls don't take anonymous arrays after seeing the procedural code that did - Chunky internal restructure. Now we compile a match sub from code fragments. Though more complex, this is a big speed win as it eliminates a lot of the subroutine dispatch. - During the restructure we lost the ->test method. I hope that it's not missed, since maintining it through a deprecation cycle would be fiddly with the current _compile code. - Split the findrule tests into their own file, and just skip the tricky ones on Win32.
- fixup an accidental warning in the stat-based tests. Caught by Alex Gough (rt.cpan.org #2138) - make the findrule tests more win32 safe/shell independent (picked up by Philip Newton) - autogenerate READMEs from bits and pieces
Richard Clamp <richardc@unixbeard.net> with input gained from this use.perl discussion: http://use.perl.org/~richardc/journal/6467
Additional proofreading and input provided by Kake, Greg McCarroll, and Andy Lester andy@petdance.com.
Copyright (C) 2002,2003 Richard Clamp. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
File::Find, Text::Glob, Number::Compare, find(1)
If you want to know about the procedural interface, see File::Find::Rule::Procedural, and if you have an idea for a neat extension File::Find::Rule::Extending
To install File::Find::Rule, copy and paste the appropriate command in to your terminal.
cpanm
cpanm File::Find::Rule
CPAN shell
perl -MCPAN -e shell install File::Find::Rule
For more information on module installation, please visit the detailed CPAN module installation guide.