Catmandu::Validator::Simple(3pm) | User Contributed Perl Documentation | Catmandu::Validator::Simple(3pm) |
Catmandu::Validator::Simple - Simple Validator for Catmandu
use Catmandu::Validator::Simple; my $validator = Catmandu::Validator::Simple->new( handler => sub { $data = shift; return "error" unless $data->{title} =~ m/good title/; return; } ); if ( $validator->is_valid($hashref) ) { save_record_in_database($hashref); } else { reject_form($validator->last_errors); }
Catmandu::Validator::Simple can be used for doing simple data validation in Catmandu.
See Catmandu::Validator for inherited methods, common configuration options, and usage.
2023-03-03 | perl v5.36.0 |