Invert the hash, putting keys in anonymous arrays,
my %hash = {1 => 'One', 2 => 'Two', 3 => 'One'}; my %ihash; push @{$ihash{$hash{$_}}}, $_ for keys %hash; print "@{$hash{One}}\n";
After Compline,
Zaxo
In reply to Re: Getting the keys of identical values in a hash
by Zaxo
in thread Getting the keys of identical values in a hash
by knsridhar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |