open(FH,"test") || die "You suck because $!"; my %hash = map {sprintf("%02d",$.--),$_} reverse ; close FH; print qq{$_ => $hash{$_}\n} for sort keys %hash;