Use values on scalar context to get the number of elements on the hash:
updated following Limbic~Region advice.foreach my $k ( keys %{$hoh} ) { if( $hoh->{$k} and values %{$hoh->{$k}}) { print "$k\n"; }; }
In reply to Re: Testing Hash with empty value in HoH
by salva
in thread Testing Hash with empty value in HoH
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |