http://qs321.pair.com?node_id=689875


in reply to Re^2: How to get Keys from hash having same value?
in thread How to get Keys from hash having same value?

I tried doing that, It is working.
use Data::Dumper; %myhash = ( 1 => 'a', 2=> 'b', 3=> 'a', 4=>'c', 5 => 'a', 6 => 'a', 7 +=>'b'); %newhash = map { ($_,$myhash{$_}) } grep { $myhash{$_} eq 'a'; } keys + %myhash ; print Dumper \%newhash;