- or download this
if ($checks{'data'} =~ /([^$checks{'regex'}])/) {
bail_out("Bad input.");
}
- or download this
if (defined $checks{'value'}) {
if (ref $checks{'value'} eq 'Regexp') {
...
unless ($checks{'data'} eq $checks{'value'});
}
}
- or download this
$email_address = sanitize(
data => param('email'),
...
max => 4,
value => qr/^(?:red|green|blue)$/,
);
- or download this
$username = sanitize(
data => param('username'),
...
max => 8,
value => qr/^[%;&()#\w ]+$/,
);
- or download this
$autosave = sanitize(
data => param('autosave'),
...
max => 2,
value => 'on', # not a regular expression; $checks{'data'} mus
+t eq "on"
);