in reply to File - sort by date (hash, array?)

Updated!

perl -e"print substr$_,6 for sort map{sprintf('%02d'x3).$_,/^(\d+)-(\d ++)-(\d+)/} <>" junk

broquaint pointed out that in my enthusiasm for golfing this I forgot to reorder the date components.

P:\test>perl CON junk print substr$_,6 for sort map{/^(\d+)-(\d+)-(\d+)/ &&sprintf('%02d'x3).$_,$3,$1,$2}<> ^Z

Not so good, but at least it works this time! Someone can do better than that I'm sure.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
If I understand your problem, I can solve it! Of course, the same can be said for you.