Try just greping:
my $non_empty = grep { $a{$_} ne "" } keys %a; print "Keys with non-empty values: $non_empty\n"; __END__ Keys with non-empty values: 2
You then need to decide whether undef of 0 entries are empty or not.
In reply to Re: Count non-empty hash values
by fishbot_v2
in thread Count non-empty hash values
by pboin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |