NAME
WWW::Mooos::Scraper::Validate - WWW::Mooos::Scraper input validate module
VERSION
0.01
DESCRIPTION
WWW::Mooos::Scraper input validate module
VALIDATE METHOD
Defined in %WWW::Mooos::Scraper::Validate::VALIDATE_METHOD
length
Length check
Example:
# in WWW::Mooos::Scraper::Validate::validate_map
param1 => [ [ "length", 30] ], # max 30
param2 => [ [ "length", 0, 30] ], # between 0 and 30
regex
Regex check
Example:
param1 => [ [ "regex", qr/^foo$/ ] ],
require
Require check
Example:
param1 => [ "require" ],
skip
When check value is undef, other checks are not done
Example:
# when param1 is not undef, length and regex check done
param1 => [ "skip", [ "length", 30 ], [ "regex", qr/bar/ ] ],
url
URL regex check
Example:
param1 => [ "url" ],
METHOD
new
Create instance
Example:
my $valid = WWW::Mooos::Scraper::Validate->new( mooos => $mooos );
validate
input validate
Example:
my($p, $e) = $valid->validate(%param);
if(keys %{$e}){
# error trap
}
ACCESSOR METHOD
mooos
Get WWW::Mooos::Scraper instance
Example:
$mooos = $self->mooos;
ABSTRACT METHOD
validate_map
validate_message
1;
__END__
SEE ALSO
Class::Accessor Readonly Sub::Install
AUTHOR
Akira Horimoto
COPYRIGHT AND LICENSE
This library is free software. You can redistribute it and/or modify it under the same terms as perl itself.
Copyright (C) 2007 Akira Horimoto