[code]
use Sort::Key::Top qw(rnkeytop);
my @top = rnkeytop { $d{$_} } 5 => keys %d;
[/code]

See also [URL="