Data::Validation::Filters - Filter data values
use Data::Validation::Filters; %config = ( method => $method, %{ $self->filters->{ $id } || {} } ); $filter_ref = Data::Validation::Filters->new_from_method( %config ); $value = $filter_ref->filter_value( $value );
Applies a single filter to a data value and returns it's possibly changed value
Defines the following attributes:
method
Name of the constraint to apply. Required
pattern
Used by "isMathchingRegex" as the pattern to match the supplied value against
replace
The replacement value used in regular expression search and replace operations
new_from_method
A class method which implements a factory pattern using the method attribute to select the subclass
filter
Calls either a builtin method or an external one to filter the data value
filterEscapeHTML
Replaces &<>" with their &xxx; equivalents
filterLowerCase
Lower cases the data value
filterNonNumeric
Removes all non numeric characters
filterReplaceRegex
Matches the regular expression pattern and substitutes the replace string
filterTitleCase
Like "filterUCFirst" but applied to every word in the string
filterTrimBoth
Remove all leading and trailing whitespace
filterUpperCase
Upper cases the data value
filterUCFirst
Upper cases the first character of the data value
filterWhiteSpace
Removes all whitespace
filterZeroLength
Returns undef if value is zero length
None
There are no known incompatibilities in this module
There are no known bugs in this module. Please report problems to http://rt.cpan.org/NoAuth/Bugs.html?Dist=Data-Validation. Patches are welcome
Larry Wall - For the Perl programming language
Peter Flanigan, <pjfl@cpan.org>
<pjfl@cpan.org>
Copyright (c) 2016 Peter Flanigan. All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic
This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
To install Data::Validation, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Validation
CPAN shell
perl -MCPAN -e shell install Data::Validation
For more information on module installation, please visit the detailed CPAN module installation guide.