my %hash = {1 => 'One', 2 => 'Two', 3 => 'One'}; my %ihash; push @{$ihash{$hash{$_}}}, $_ for keys %hash; print "@{$hash{One}}\n";