3 File::Find::Rule::Procedural - File::Find::Rule's procedural interface
9 # find all .pm files, procedurally
10 my @files = find(file => name => '*.pm', in => \@INC);
14 In addition to the regular object-oriented interface,
15 L<File::Find::Rule> provides two subroutines for you to use.
19 =item C<find( @clauses )>
21 =item C<rule( @clauses )>
23 C<find> and C<rule> can be used to invoke any methods available to the
24 OO version. C<rule> is a synonym for C<find>
28 Passing more than one value to a clause is done with an anonymous
31 my $finder = find( name => [ '*.mp3', '*.ogg' ] );
33 C<find> and C<rule> both return a File::Find::Rule instance, unless
34 one of the arguments is C<in>, in which case it returns a list of
35 things that match the rule.
37 my @files = find( name => [ '*.mp3', '*.ogg' ], in => $ENV{HOME} );
39 Please note that C<in> will be the last clause evaluated, and so this
40 code will search for mp3s regardless of size.
42 my @files = find( name => '*.mp3', in => $ENV{HOME}, size => '<2k' );
45 Clause processing stopped here ------/
47 It is also possible to invert a single rule by prefixing it with C<!>
50 # large files that aren't videos
51 my @files = find( file =>
52 '!name' => [ '*.avi', '*.mov' ],
59 Richard Clamp <richardc@unixbeard.net>
63 Copyright (C) 2003 Richard Clamp. All Rights Reserved.
65 This module is free software; you can redistribute it and/or modify it
66 under the same terms as Perl itself.