NAME

Validator::Var - variable validator with expandable list of checkers.

VERSION

Version 0.01

SYNOPSIS

   use Validator::Var;
   my $var;
   
   ...

   my $num_bitween = Validator::Var->new();
   $foo->checker(Between, 0, 100);
   unless ( $foo->is_valid( $var ) ) {
       warn "variable is not bitween 0 an 100";
   }

   my $number = Validator::Var->new();
   $number->checker(Regexp, '^d+$');
   
   unless ( $bar->is_valid( $var ) ) {
       warn "variable is not a number";
   }
   
   my $ref_validator = Validator::Var->new();
   $ref_validator->checker(Ref, qw(REF Foo Bar));
   unless ( $bar->is_valid( $var ) ) {
       warn "variable is not a number";
   }


   ...

METHODS

new( [at_least_one] )

Creates new variable validator. If at_least_one is provided and it is true ...

is_empty( )

Checks if variable validator has not any checker.

at_least_one( boolean )

checker( checker-spec )

checkers_not_passed( )

is_valid( var [, do_trace] )

Checks if variable value is valid according to specified checkers. If do_trace is provided and it is true ...

AUTHOR

Fedor Semenov, <fedor.v.semenov at gmail.com>

BUGS

Please report any bugs or feature requests to bug-validator-var at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Validator-Var. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Validator::Var

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2011 Fedor Semenov.

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.