#!/usr/bin/perl -w

use strict;

my %tmp = (
  "key1" => 3,
  "key2" => 6,
  "key3" => 1,
  "key4" => 3,
);

for my $key ( sort { $tmp{$b} <=> $tmp{$a} } keys %tmp ) {
	printf "%s => %d\n", $key, $tmp{ $key };
}