in reply to Length validation

Unless there's more to the hash references you're putting in @error, the hash reference itself is rather useless. That being said, you can do:
my @error = map $error_msg{$_}, grep length(param($_)) >= $error_length{$_}, @$valids;
You can't just use $_ >= $error_length{$_}, since $_ is a field name. You need to get the value of that field, and find its length. I've done so using the CGI module.

japhy -- Perl and Regex Hacker