in reply to What is the best way to validate data ?

How do I detect and handle empty form fields? asks a similar question. It is more specifically CGI-related, but...

my @InvalidFields = grep {not defined CGI::param($_) or CGI::param($_) eq ''} CGI::param +();

@InvalidFields will now contain the names of any empty fields.

If you are not working with CGI, just replace the param calls with appropriate data structures.

my @InvalidFields = grep {not defined $Hash($_) or $Hash($_) eq ''} keys %Hash;
Russ