in reply to Validating incoming CGI form data

Just a couple of suggestions:

Don't use &subroutine; unless you're sure that you want to do that. You very likely want subroutine(); instead.

As for cleaning the code a litte: you could do something like:

Warning: untested code ahead

my %opts = ( bandwidth => { err => 'Your Chosen Bandwidth Option Does Not Appear To Be Valid. Contact Support For Assistance.', match => qr/^15|0$/, }, support => { err => 'Your Chosen Support Option Does Not Appear To Be Valid. Contact Support For Assistance.', match => qr/^2|0$/, } # etc etc. ); my $error = ''; while (my ($name,$check) = each(%opts)) { unless ($q->param($name) =~ $check->{match}) { $error .= "<p>$check->{err}</p>\n"; } } if ($error) { print_error($error); }
At least I think it looks a little better :-)
-- Joost downtime n. The period during which a system is error-free and immune from user input.