in reply to Form Verification

I think the error lies in how you're generating $input, or perhaps in how it is scoped. Since we have absolutely no information to go on here, be sure you're not putting stuff in %input instead, for example, but calling $input as a hash reference. Be sure you're using strict and warnings (which would catch that). Come to us with more information about how that variable is built if you still have problems.

You also probably want to test for "trueness" or the presence of a non-whitespace character ($whatever =~ /\S/) instead of defined if your goal is to prevent empty fields. If you want to see if $field is present in the list of keys in a %hash, you usually want exists instead of defined.