NAME

Validator::Custom::Trim - (Deprecated) Space triming;

CAUTHION

This module is deprecated. constraints of this module moved to Validator::Custom.

SYNOPSIS

use Validator::Custom::Trim;

my $data = {
    key1  => ' 123 ',
    key2  => "  \n a \r\n b\nc  \t",
    key3  => '  abc  ',
    key4  => '  def  '
};

my $rule = [
  key1 => [
      ['trim']           # ' 123 ' -> '123'
  ],
  key2  => [
      ['trim_collapse']  # "  \n a \r\n b\nc  \t" -> 'a b c'
  ],
  key3      => [
      ['trim_lead']      # '  abc  ' -> 'abc   '
  ],
  key4     => [
      ['trim_trail']     # '  def  ' -> '   def'
  ]
];

my $vc = Validator::Custom::Trim->new;
my $result = $vc->validate($data, $rule);
my $trimed = $result->data->{'key1'};

DESCRIPTIONS

Validator::Custom::Trim is space triming filter. This class inherit all methods from Validator::Custom. If you know usage of This module, See Validator::Custom documentation.

METHODS

This module is subclass of Validator::Custom. All methods of Validator::Custom is available.

CONSTRAINT FUNCTIONS

trim

trim leading and trailing white space

trim_lead

trim leading white space

trim_trail

trim trailing white space

trim_collapse

Trim leading and trailing white space, and collapse all whitespace characters into a single space.

STABILITY

Validator::Custom::HTMLForm is stable. The following constraint function keep backword compatible.

# Constraint functions
trim
trim_lead
trim_trail
trim_collapse

AUTHOR

Yuki Kimoto, <kimoto.yuki at gmail.com>

COPYRIGHT & LICENSE

Copyright 2009 Yuki Kimoto, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.