| WWW-Mooos-Scraper documentation | view source | Contained in the WWW-Mooos-Scraper distribution. |
WWW::Mooos::Scraper::Validate - WWW::Mooos::Scraper input validate module
0.01
WWW::Mooos::Scraper input validate module
Defined in %WWW::Mooos::Scraper::Validate::VALIDATE_METHOD
Length check
Example:
# in WWW::Mooos::Scraper::Validate::validate_map param1 => [ [ "length", 30] ], # max 30 param2 => [ [ "length", 0, 30] ], # between 0 and 30
Regex check
Example:
param1 => [ [ "regex", qr/^foo$/ ] ],
Require check
Example:
param1 => [ "require" ],
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 regex check
Example:
param1 => [ "url" ],
Create instance
Example:
my $valid = WWW::Mooos::Scraper::Validate->new( mooos => $mooos );
input validate
Example:
my($p, $e) = $valid->validate(%param);
if(keys %{$e}){
# error trap
}
Get WWW::Mooos::Scraper instance
Example:
$mooos = $self->mooos;
1;
__END__
Akira Horimoto
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
| WWW-Mooos-Scraper documentation | view source | Contained in the WWW-Mooos-Scraper distribution. |