sub validate{
my $self = shift;
my $errors_ref;
my $validation_profile = $self->get_validation_profile();
my $input = $self->get_input();
my $result = $self->process_input_against_profile(
$input => $validation_profile );
if ( $result->{success} ) {
return { success => 1 };
}
else {
$errors_ref = $self->process_errors( $result );
return {
success => 0,
errors => $errors_ref,
};
}
}
####
sub validate{
my $self = shift;
return Validator->new( $self->get_input )->validate();
}
package Validator;
sub validate{
my $validator = shift;
my $result = $validator->process_input_against_profile();
if ( $result->success() ) {
return { success => 1 };
}
else {
return {
success => 0,
errors => $result->errors(),
};
}
}
####
perl -e 'split//,q{john hurl, pest caretaker}and(map{print @_[$_]}(join(q{},map{sprintf(qq{%010u},$_)}(2**2*307*4993,5*101*641*5261,7*59*79*36997,13*17*71*45131,3**2*67*89*167*181))=~/\d{2}/g));'