in reply to sorted Hash
You need numerical sort, try the following
for $key ( sort {$a<=>$b} keys %hash) { print "($key)->($hash{$key})\n"; }
In your way with foreach
Update:foreach (sort { $a <=> $b } keys(%SRV) ) { print"$_: "."$SRV{$_}"; }
foreach code added
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: sorted Hash
by intoperl (Acolyte) on Aug 22, 2015 at 16:04 UTC | |
by 1nickt (Canon) on Aug 22, 2015 at 16:17 UTC |