While you are constrained as to the kind of input you get, maybe you don't need to stick rigorously to that constraint when presenting the info to the user. I would seriously consider editing the input list to normalize the date field to a consistent form, so that sorting on the date field will be trivial (as opposed to being complicated).

As suggested in an earlier reply, you should (if at all possible) use the SunOS 'ls' option that yields a consistent date format in its output, then use one of the many Date::whatever modules (or a regex) to convert that to YYYY-MM-DD HR:MI:SC, which doesn't need any special treatment when sorting (ascii-betic sort == chronological sort). People ought to find this display format easy enough to read, and you can use that edited form of the data for both sorting and display.

Don't hesitate to allow sorting on the permission field -- an (ascending or descending) ascii-betic sort on that can be surprisingly handy in some situations (e.g. to understand why some people aren't able to see the contents of some files...)

Meanwhile, the link-count and block-count fields are relatively worthless -- if you're going to be editing the 'ls' output anyway (to make the date field manageable), I would take those two out completely; don't even show them to a GUI user.


In reply to Re: Excel-like sort for multiple fields unix 'ls -l' output by graff
in thread Excel-like sort for multiple fields unix 'ls -l' output by cmv

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.