This actually appears to be in followup to Sorting question..., and in specific, he's using an adaptation on the example code I provided in Re: Sorting question....

An example of the dataset is provided in the parent node of that thread. And a description of my proposed solution is provided within that thread as well.

The solution will need to be reworked a bit if the assumptions I made (and documented) in my original solution aren't accurate. In particular, I would be concerned with how records are delimited, and the exact order of lines within each record. But with those caviets, the solution should work as long as the user massages it to find the right line within each record.

If I had the solution to write again, given the ambiguity of the original dataset, I might grep each record to find the element on which the sort criteria is based, instead of indexing into is (which assumes a fixed and known position). Then I would split the results of the grep and build my ST data-structure in that way. It would be slower to set up each ST (because grepping a six-element record is slower than indexing its 4th element), but it would be more robust and less likely to break if records change size in the future.


Dave


In reply to Re: Re: Lost contents of arrays... by davido
in thread Lost contents of arrays... by fiddler42

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.