What's wrong with Data::Validate? Or, for that matter, just using CGI to do the hard parsing work, and validating from there?
#!/bin/perl -T use CGI; use Data::Validate ':math'; my $q = CGI->new(); foreach my $p ( $q->param ) { my $val = $q->param($p); if ( defined is_alphanumeric($val) ) { $q->param(-name=>$p, -value=>is_alphanumeric($val)); #untaint! } else { warn "Parameter '$p' is not alphanumeric!" } }
Don't reinvent wheels when people have already done the work for you! :-)
In reply to Re: CGI: check Form input
by radiantmatrix
in thread CGI: check Form input
by pro7agon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |