in reply to Testing Hash with empty value in HoH
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"; }; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Testing Hash with empty value in HoH
by Limbic~Region (Chancellor) on Jun 15, 2005 at 12:40 UTC |