Data::Transpose::Validator::Base - Base class for Data::Transpose::Validator
my $v = Data::Transpose::Validator::Base->new; ok($v->is_valid("string"), "A string is valid"); ok($v->is_valid([]), "Empty array is valid"); ok($v->is_valid({}), "Empty hash is valid"); ok(!$v->is_valid(undef), "undef is not valid");
Constructor. It accepts an hash with the options.
Main method. Return true if the variable passed is defined, false if it's undefined, storing an error.
Main method to check why the validator returned false. When an argument is provided, set the error.
In scalar context it returns a human-readable string with the errors.
In list context it returns the raw error list, where each element is a pair of code and strings.
Clear the errors stored.
Returns the list of the error codes for the current validation.
To install Data::Transpose, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Transpose
CPAN shell
perl -MCPAN -e shell install Data::Transpose
For more information on module installation, please visit the detailed CPAN module installation guide.