Hello,
I forgot to mention I am coding this thing in PERL. I wish to have a 2D array of all those values so that I may process the array further.
I believe to do it in the elegant way you suggested, I would have to output that array in a file first- say junk.txt
"System" command would help me with the "sort" command.
I will again have to retrieve the sorted file and slurp it in an array once more.
I really do not wish to have that overhead but if most would agree that this is the easiest way to go about it I would go ahead and use it.

In reply to Re^2: Sort a 2D array based on 2 columns by masala_curry
in thread Sort a 2D array based on 2 columns by masala_curry

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.