File::Find::MatchPerform different actions on files based on file name | |
Download |
File::Find::Match Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Dylan William Hardison
- Publisher web site:
- http://search.cpan.org/~dhardison/
File::Find::Match Tags
File::Find::Match Description
Perform different actions on files based on file name File::Find::Match is a Perl module that allows one to recursively process files and directories based on the filename. It is meant to be more flexible than File::Find.SYNOPSIS #!/usr/bin/perl use strict; use warnings; use File::Find::Match qw( :constants ); use File::Find::Match::Util qw( filename ); my $finder = new File::Find::Match( filename('.svn') => sub { IGNORE }, qr/.pm$/ => sub { print "Perl module: $_ "; MATCH; }, qr/.pl$/ => sub { print "This is a perl script: $_ "; # let the following rules have a crack at it. }, qr/filer.pl$/ => sub { print "myself!!! $_ "; MATCH; }, -d => sub { print "Directory: $_ "; MATCH; }, # default is like an else clause for an if statement. # It is run if none of the other rules return MATCH or IGNORE. default => sub { print "Default handler. "; MATCH; }, ); $finder->find; Requirements: · Perl
File::Find::Match Related Software