foreach $keyOut (sort {$a cmp $b} keys %hshOut) { ... }