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.
|
|---|