%h = (1 => 2, a=>"b", c => 2); %h = reverse (%x = reverse %h); foreach my $n (keys %h) { print "$n $h{$n}\n"; }