]> Dogcows Code - chaz/p5-CGI-Ex/blob - samples/devel/dprof_validation.d
CGI::Ex 2.27
[chaz/p5-CGI-Ex] / samples / devel / dprof_validation.d
1 # -*-perl-*-
2 # run with perl -d:DProf $0
3
4 use CGI::Ex::Validate;
5
6 my $form = {
7 username => "++foobar++",
8 password => "123",
9 password2 => "1234",
10 };
11
12 my $val_hash_ce = {
13 'group no_alert' => 1,
14 'group no_confirm' => 1,
15 username => {
16 required => 1,
17 match2 => 'm/^\w+$/',
18 match2_error => '$name may only contain letters and numbers',
19 # untaint => 1,
20 },
21 password => {
22 required => 1,
23 min_len => 6,
24 max_len => 30,
25 match => 'm/^[ -~]+$/',
26 # untaint => 1,
27 },
28 password2 => {
29 validate_if => 'password',
30 equals => 'password',
31 },
32 email => {
33 required => 1,
34 match => 'm/^[\w\.\-]+\@[\w\.\-]+$/',
35 # untaint => 1,
36 },
37 };
38
39
40 for (1 .. 10_000) {
41 my $err_obj = CGI::Ex::Validate->validate($form, $val_hash_ce);
42 # my $err_obj = CGI::Ex::Validate->validate($form, $val_hash_ce)->as_hash;
43 }
This page took 0.034198 seconds and 4 git commands to generate.