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

In reply to sorted Hash by intoperl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.