#!/usr/bin/perl use strict; use warnings; my %tmp = ( a=>1, b=>2, c=>3 ); my @vals = @tmp{reverse sort keys %tmp}; print "@vals\n";