in reply to Count non-empty hash values
or this for the second:@values = values(%hash); foreach $i (@values) { $count ++ if defined($i); }
I also found that@values = values(%hash); foreach $i (@values) { $count ++ if $i; }
seems to work$count = (grep { /^$/ } values(%hash))- scalar(values(%hash);
emc
|
|---|