for $key (sort {$a <=> $b} keys %sortListArr) ... #### for $key (sort {$sortListArr{$a} cmp $sortListArr{$b}} keys %sortListArr) ...