my %hash = ( apple => 'red', banana => 'yellow', orange => 'orange', lemon => 'yellow', ); my $value = 'yellow'; my @matching_keys = grep { $hash{$_} eq $value } keys %hash; print("$_\n") foreach @matching_keys;
In reply to Re: Getting Keys of Hash from Values
by ikegami
in thread Getting Keys of Hash from Values
by jesuashok
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |