Server IP : 85.214.239.14 / Your IP : 18.227.134.165 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/2/root/proc/3/task/3/cwd/usr/share/perl5/File/Find/Rule/ |
Upload File : |
=head1 NAME File::Find::Rule::Procedural - File::Find::Rule's procedural interface =head1 SYNOPSIS use File::Find::Rule; # find all .pm files, procedurally my @files = find(file => name => '*.pm', in => \@INC); =head1 DESCRIPTION In addition to the regular object-oriented interface, L<File::Find::Rule> provides two subroutines for you to use. =over =item C<find( @clauses )> =item C<rule( @clauses )> C<find> and C<rule> can be used to invoke any methods available to the OO version. C<rule> is a synonym for C<find> =back Passing more than one value to a clause is done with an anonymous array: my $finder = find( name => [ '*.mp3', '*.ogg' ] ); C<find> and C<rule> both return a File::Find::Rule instance, unless one of the arguments is C<in>, in which case it returns a list of things that match the rule. my @files = find( name => [ '*.mp3', '*.ogg' ], in => $ENV{HOME} ); Please note that C<in> will be the last clause evaluated, and so this code will search for mp3s regardless of size. my @files = find( name => '*.mp3', in => $ENV{HOME}, size => '<2k' ); ^ | Clause processing stopped here ------/ It is also possible to invert a single rule by prefixing it with C<!> like so: # large files that aren't videos my @files = find( file => '!name' => [ '*.avi', '*.mov' ], size => '>20M', in => $ENV{HOME} ); =head1 AUTHOR Richard Clamp <richardc@unixbeard.net> =head1 COPYRIGHT Copyright (C) 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. =head1 SEE ALSO L<File::Find::Rule> =cut