for $key ( sort {$a<=>$b} keys %hash) { print "($key)->($hash{$key})\n"; } #### foreach (sort { $a <=> $b } keys(%SRV) ) { print"$_: "."$SRV{$_}"; }