Skip to content
My common Mojo stuff
Pull request Compare This branch is even with vti:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


my $validator = MojoX::Validator->new;

# Fields
$validator->field([qw/firstname lastname/])->required(1)->length(3, 20);

# Groups
$validator->field([qw/password confirm_password/])->required(1);
$validator->group('passwords' => [qw/password confirm_password/])->equal;

# Conditions
  ->then(sub { shift->field('number')->required });

my $errors_hashref = $validator->errors;
my $validated_values_hashref = $validator->values;

Bot protection



  • Dummy field (bot fills out all the fields, including not visible one)
  • Honeypot form (bot submits non visible to a normal user form)
  • Cookies support check (bot has no cookies support)
  • Referrer check (bot submits form with invalid referrer header)
  • Identical fields check (bot submits form with identical fields)
  • Form signature (bot submits without visiting the form page or does it too fast)
  • Flood protection (bot submits forms too fast)
  • DDoS protection (bot submits the same forms many times)
Something went wrong with that request. Please try again.