foreach my $i (sort (-20 .. 20)) { print "$i\n"; } #### sort {$a <=> $b} (keys %hashone)