Note that both snippets will behave in probably undesired ways if any of the parameters have multiple values.while(my ($param, $rx) = each %laundry) { local $_ = $cgi->param($param) or die "Parameter $param not present\n"; ($laundered_params{$param}) = /$rx/; or die "Invalid input for $param\n"; }
Makeshifts last the longest.
In reply to Re^2: Validating incoming CGI form data (more concise)
by Aristotle
in thread Validating incoming CGI form data
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |