Calling $q->param will give you a list of all field names from the cgi object. Something like the following untested code should apply your regexes to each field value.
my @fields = $q->param; for my $name ( @fields ){ my @vals = $q->param($name); for my $value( @vals ){ # apply regexes here $value =~ s/... $value =~ s/... $value =~ s/... } if (@vals > 1){ $q->param(name => $name, values => [ @vals ]); }else{ $q->param(name => $name, value => $vals[0] ); } }
Update: Applied correction and clarification per post below. Thanks Mom, I'll try not to be in such a hurry next time. ;-}
In reply to Re: Form Security
by hangon
in thread Form Security
by virtualweb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |