in reply to Seeing if a hash has one arbitrary key
That looks complicated (though it isn't really).
I'd probably use a temporary:
I'd probably use a temporary:
for my $c ( keys %h ) { my @attr = keys %{$h{$c}}; if ( @attr == 1 and $h{$c}{$attr[0]} == 1 ) { print "$c has a $attr[0]\n"; } . . .
jdporter
The 6th Rule of Perl Club is -- There is no Rule #6.
|
---|
In Section
Cool Uses for Perl