intoperl has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks, I need my hash table to printed out nicely and "SORTED". But looks like i am missing someting, Pls see the code below and the output :
Code : foreach(sort keys %SRV) { print"$_: "."$SRV{$_}"; } OutPut: Enter the Serial No. against the server you want to check CPU for: + 1 zumen530n.pdg.duranto.com 10 zumen546n.pdg.duranto.com 11 zumen547n.pdg.duranto.com 12 zumen548n.pdg.duranto.com 13 zumen549n.pdg.duranto.com 14 zumen550n.pdg.duranto.com 15 zumen551n.pdg.duranto.com 16 zumen552n.pdg.duranto.com 17 zumen553n.pdg.duranto.com 18 zumen21n.pdg.duranto.com 19 zumen22n.pdg.duranto.com 2 zumen531n.pdg.duranto.com 20 zumen23n.pdg.duranto.com 21 zumen24n.pdg.duranto.com 3 zumen532n.pdg.duranto.com 4 zumen533n.pdg.duranto.com 5 zumen540n.pdg.duranto.com 6 zumen541n.pdg.duranto.com 7 zumen542n.pdg.duranto.com 8 zumen543n.pdg.duranto.com 9 zumen544n.pdg.duranto.com
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: sorted Hash
by vinoth.ree (Monsignor) on Aug 22, 2015 at 15:58 UTC | |
by intoperl (Acolyte) on Aug 22, 2015 at 16:04 UTC | |
by 1nickt (Canon) on Aug 22, 2015 at 16:17 UTC | |
|
Re: sorted Hash
by GotToBTru (Prior) on Aug 23, 2015 at 03:56 UTC | |
by AnomalousMonk (Archbishop) on Aug 23, 2015 at 14:53 UTC | |
|
Re: sorted Hash
by Not_a_Number (Prior) on Aug 23, 2015 at 17:03 UTC | |
by marioroy (Prior) on Aug 24, 2015 at 06:29 UTC | |
|
Re: sorted Hash
by locked_user sundialsvc4 (Abbot) on Aug 23, 2015 at 13:36 UTC |