Validator - Input params validator
use Validator; my $fields = [ { name => 'Integer', error => 'Bad format for Integer', value => 43, rules => [ { rule => 'integer' }, { rule => 'maxlength', param => 1 }, ] }, { ... } ]; my $validator = Validator->new(); $validator->fields($fields); my $valid = $validator->isValid(); if ( ref $valid eq 'Validator::ErrorCode' ) { # error handling $valid->errorCode(); # or $valid->errorMsg(); }
Class for input method validation by rules from Validator::Rules::Base
TODO
Alex Nosoff <plcgi1@gmail.com>
Copyright (C) 2000 by Alex Nosoff
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.
To install Validator, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Validator
CPAN shell
perl -MCPAN -e shell install Validator
For more information on module installation, please visit the detailed CPAN module installation guide.