## also loads File::Find::Rule::Age use File::Find::Rule qw/ find rule :Age /; { my @files = find( file => age => [ newer => '1D' ], in => [ $dir ] + ); dd( \@files ); my $counter = 0; my $printer = sub { $counter++; print "$counter $_[2]\n"; return !!0; ## means discard }; ## look ma, no iterator required :) ## nothing returned because $printer discards ... @files = rule( file => age => [ newer => '1D' ], exec => $printer +)->in( $dir ); dd( \@files ); } __END__ ["today/a/hi.txt", "today/b/bye.txt"] 1 today/a/hi.txt 2 today/b/bye.txt []
In reply to Re: File test in grep not excluding current directory ( use File::Find::Rule qw/ find rule :Age /; )
by Anonymous Monk
in thread File test in grep not excluding current directory
by GotToBTru
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |