The only sort that happens is the one I've shown you, on the array constructed above (notice the array name, @Notes). There is nothing else to it. You have 100% of the code in which @Notes is referenced here, and 100% of the code which constructed it. If anyone wants to take the time to look for errors, I'm of course grateful. Just to be extra clear:
  1. @Notes is constructed using the code and package above.
  2. @Notes is sorted using the code shown earlier.
  3. Sorted array is displayed making use of PNSearch::highlight, but this is subsequent to everything else; in fact I've been logging this with "die" right after the sort. Without that die all the notes do appear correctly, by which point the data has passed through more than a few error checks. As I said, none of those if (!defined) fire, I'm logging warnings and making them fatal, use strict, use Taint, not a peep. Numbers compare to numbers, strings are not mixed up, mangled, or foreshortened etc, etc. On visual inspection all the search finds and highlights are also correct.

Maybe also worth mentioning this is a revision (new features) of code I wrote last year that has been used on a production server daily since then. So it's already gone thru a lot of tweaking, testing, usage/error logging, and debugging. I've been asked to implement this elsewhere, and I've never received any complaints.


In reply to Re^9: sort != sort by halfcountplus
in thread sort != sort by halfcountplus

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.