Ok, I have an issue *heh* I have these values;
041351920234 Rabbit 0343120 041271024500 0430870 Apple 041460301399
I have tried several "comparators" to "alphabatize" the list(individually)to try to get;
Apple Rabbit 0343120 0430870 041271024500 041351920234 041460301399
To no avail, i tried using gt and lt as comparators but it puts them in the "wrong" order;
Apple Rabbit 0343120 041351920234 0430870 041271024500 041460301399
I tried > and < to compare the values and it doesn't sort the Apple and Rabbit correctly becuase (obviously) perl interpets these two as "0" integers.
Rabbit Apple 0343120 0430870 041271024500 041351920234 041460301399

I'm dealing with both "numbers" and "text" but i can't figure out how to get perl to handle the numbers correctly or the text vica-versa. I don't want to use the "sort { $a->[0] <=> $b->[0] }" approach because I'm using a very large database and don't want to have "not-enough" ram/memory problems.

Anyone have a soloution, routine, or procedure to accomplish what I'm trying to do here? Goal is to create an alphabatized file of items(/numbers).

I did try re-inventing the wheel...But it kept getting stuck on the corners

In reply to Sorting Numbers & Text by PriNet

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.