Skip Menu |

This queue is for tickets about the File-Find-Rule CPAN distribution.

Report information
The Basics
Id: 6266
Status: rejected
Priority: 0/
Queue: File-Find-Rule

People
Owner: Nobody in particular
Requestors: ch [...] ngmedia.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: and method
Hi I´m a great fan of File::Find::Rule. One thing i miss is a add method. #!/usr/bin/perl use strict; use warnings; use File::Find::Rule; sub File::Find::Rule::and { my $self = shift; push @{ $self->{rules} }, { rule => 'and', code => '(' . join( ' && ', map { "( " . $_->_compile( $self->{subs} ) . " )" } @_ ) . ")", args => \@_, }; $self; } my @rules = ( File::Find::Rule->file, File::Find::Rule->readable, File::Find::Rule->size('<2M'), ); my $find = File::Find::Rule->new; $find->and(@rules)->start('/usr/local/bin'); while ( my $file = $find->match ) { print $file, "\n"; } regards Christian Hansen