my %c = ( a=>1, b=>2, c=>3 ); my %rev_c = reverse %c; use Data::Dumper;print Dumper \%rev_c; __END__ $VAR1 = { '1' => 'a', '3' => 'c', '2' => 'b' };