Input::Validator::Condition - Condition object
$validator->when('document')->regexp(qr/^1$/) ->then(sub { shift->field('number')->required(1) });
Condition object.
then
$condition->then(sub { ... });
Holds callback that is called when conditions is matched.
constraint
$condition->consraint(length => [1, 3]);
Adds a constraint.
length
Shortcut
$condition->consraint(length => @_);
match
my $matched = $condition->match;
Check whether conditions is matched.
regexp
$condition->consraint(regexp => @_);
when
$condition->when('foo'); $condition->when(qw/foo bar/); $condition->when([qw/foo bar baz/]);
Adds fields which values are checked to match the condition.
Input::Validator, Input::Validator::Field, Input::Validator::Constraint
To install Input::Validator, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Input::Validator
CPAN shell
perl -MCPAN -e shell install Input::Validator
For more information on module installation, please visit the detailed CPAN module installation guide.