NAME
File::Find::Match::Sugar - Syntax sugar functions for File::Find::Match.
SYNOPSIS
See File::Find::Match.
DESCRIPTION
The module exports a few functions that makes writing File::Find::Match rules a bit prettier. Because, let's face it, writing sub { 1 } => sub { ... }
is not nearly as nice as default { ... }
.
EXPORT
The functions dir(), file(), and default() are exported by default.
FUNCTIONS
These functions provide a bit of syntax sugar. All of them are prototyped as foo (&)
, and thus you may call them as foo { ... }
instead of foo( sub { ... } )
.
All of them return a predicate => action pair, also called a rule. See "RULES" in File::Find::Match for details on rules.
file($coderef)
This is the same as sub { -f $_ } => $coderef
.
dir($coderef)
This is the same as sub { -d $_ } => $coderef
.
default($coderef)
This is the same as sub { 1 } => $coderef
.
You may think of this as similiar to an the else clause of an if statement.
AUTHOR
Dylan William Hardison <dhardison@cpan.org>
SEE ALSO
File::Find::Match
, File::Find, perl(1).
COPYRIGHT and LICENSE
Copyright (C) 2004 Dylan William Hardison. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1;