Data::Verifier::Field - Field from a Data::Verifier profile
use Data::Verifier; my $dv = Data::Verifier->new(profile => { name => { required => 1, type => 'Str', filters => [ qw(collapse trim) ] } age => { type => 'Int'; }, sign => { required => 1, type => 'Str' } }); my $results = $dv->verify({ name => 'Cory', age => 'foobar' }); my $field = $results->get_field('name); say $field->value;
The string value of the field before any coercion. This will survive serialization whereas value will not.
If this field is invalid then this attribute should contain a "reason". Out of the box it will always contain a string. One of:
Boolean value representing this fields validity.
The value of this field. This will not be present if serialized, as it could be any value, some of which we may not know how to Serialize. See original_value.
original_value
A dependent check failed.
Predicate for the coerced_value attribute.
coerced_value
The value was larger than the field's max length.
The value was shorter than the field's min length.
The post check failed.
The value did not pass the type constraint.
Clears the value attribute.
Cory G Watson, <gphat at cpan.org>
<gphat at cpan.org>
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.
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
To install Data::Verifier, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Verifier
CPAN shell
perl -MCPAN -e shell install Data::Verifier
For more information on module installation, please visit the detailed CPAN module installation guide.