++ed by:
ETHER WREIS MARSENI SKAUFMAN GENEHACK

5 PAUSE users
1 non-PAUSE user.

Cory G Watson

NAME

Data::Verifier::Filters - Filters for values

SYNOPSIS

    $dv->verify({
        name => {
            type    => 'Str'
            filters => [ qw(collapse trim) ]
        }
    });
    $dv->get_value('name');

CUSTOM FILTERS

Adding a custom filter may be done by providing a coderef as one of the filters:

  # Remove all whitespace
  my $sub = sub { my ($val) = @_; $val =~ s/\s//g; $val }

  $dv->verify({
    name => {
      type    => 'Str'
        filters => [ $sub ]
      }
  });
  $dv->get_value('name'); # No whitespace!

FILTERS

These filters are supplied free of charge. Since they are common, it made sense to include them. Patches are welcome for other filters that might be used commonly.

collapse

Collapses all consecutive whitespace into a single space

flatten

Removes all whitespace.

lower

Converts the value to lowercase.

trim

Removes leading and trailing whitespace

upper

Converts the value to uppercase.

AUTHOR

Cory G Watson, <gphat at cpan.org>

COPYRIGHT & LICENSE

Copyright 2009 Cold Hard Code, LLC

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.