in reply to CGI: check Form input

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! :-)

<-radiant.matrix->
A collection of thoughts and links from the minds of geeks
The Code that can be seen is not the true Code
I haven't found a problem yet that can't be solved by a well-placed trebuchet