Just to clarify (it's Saturday; I left several IQ points at the office): by empty do you mean the key exists but its value is undefined or do you mean the key exists but its value evaluates to false?
My brute force and ignorance approach would be something like this for the first case:
@values = values(%hash);
foreach $i (@values)
{
$count ++ if defined($i);
}
or this for the second:
@values = values(%hash);
foreach $i (@values)
{
$count ++ if $i;
}
I also found that
$count = (grep { /^$/ } values(%hash))- scalar(values(%hash);
seems to work