Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / File / Find / Rule / Procedural.pod
CommitLineData
3fea05b9 1=head1 NAME
2
3File::Find::Rule::Procedural - File::Find::Rule's procedural interface
4
5=head1 SYNOPSIS
6
7 use File::Find::Rule;
8
9 # find all .pm files, procedurally
10 my @files = find(file => name => '*.pm', in => \@INC);
11
12=head1 DESCRIPTION
13
14In addition to the regular object-oriented interface,
15L<File::Find::Rule> provides two subroutines for you to use.
16
17=over
18
19=item C<find( @clauses )>
20
21=item C<rule( @clauses )>
22
23C<find> and C<rule> can be used to invoke any methods available to the
24OO version. C<rule> is a synonym for C<find>
25
26=back
27
28Passing more than one value to a clause is done with an anonymous
29array:
30
31 my $finder = find( name => [ '*.mp3', '*.ogg' ] );
32
33C<find> and C<rule> both return a File::Find::Rule instance, unless
34one of the arguments is C<in>, in which case it returns a list of
35things that match the rule.
36
37 my @files = find( name => [ '*.mp3', '*.ogg' ], in => $ENV{HOME} );
38
39Please note that C<in> will be the last clause evaluated, and so this
40code will search for mp3s regardless of size.
41
42 my @files = find( name => '*.mp3', in => $ENV{HOME}, size => '<2k' );
43 ^
44 |
45 Clause processing stopped here ------/
46
47It is also possible to invert a single rule by prefixing it with C<!>
48like so:
49
50 # large files that aren't videos
51 my @files = find( file =>
52 '!name' => [ '*.avi', '*.mov' ],
53 size => '>20M',
54 in => $ENV{HOME} );
55
56
57=head1 AUTHOR
58
59Richard Clamp <richardc@unixbeard.net>
60
61=head1 COPYRIGHT
62
63Copyright (C) 2003 Richard Clamp. All Rights Reserved.
64
65This module is free software; you can redistribute it and/or modify it
66under the same terms as Perl itself.
67
68=head1 SEE ALSO
69
70L<File::Find::Rule>
71
72=cut