sub myMethod { ... foreach $keyOut (sort {$a <=> $b} keys %hshOut) { ... } ... }