Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Why sort at all?

The problem is to find the oldest file, that's it.

just walk the list of files, and compare every one to the 'currently newest', this would be the most efficient solution.

I'm shocked that people actually suggested Shwartzian Transform and similiarly overgrown solutions to such simple problem.


In reply to Re: Finding oldest file in directory by Eyck
in thread Finding oldest file in directory by Nitrox

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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    [1nickt]: Corion this looks good, from the pod: "there are 9000+ variations that are detected correctly in the test files (see t/data/* for most of them). If you can think of any that I do not cover, please let me know."
    [TCLion]: some moron put the date like this : Mon Feb 20 09:31:30 2017
    [Corion]: 1nickt: Yes, the module sounds promising indeed
    [1nickt]: "putting the date in correct order" how?
    [Corion]: TCLion: Whee ;)
    [TCLion]: need to put like this : 2017-02-20 09:30:53
    [1nickt]: That's why I asked if you are using DateTime. It has a large number of supporting modules (the author likes the term 'eco-system') so if you are already creating a DateTime obj from your dates, this module would read in the mnoron-formatted 1s seamlessly
    [TCLion]: when I put the date together it looks like : 2017-Feb-24 (month is the problem)
    [1nickt]: good luck, then.
    [TCLion]: looking at DateTime documentation in monastery now

    How do I use this? | Other CB clients
    Other Users?
    Others musing on the Monastery: (11)
    As of 2017-03-23 14:57 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Should Pluto Get Its Planethood Back?



      Results (288 votes). Check out past polls.