laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Dates can be compared as strings if they follow the YYYY-MM-DD pattern (compulsory xkcd reference).
For longer lists, you might want to use the Schwartzian transform so Perl doesn't have to convert each date several times. Better yet, store the dates directly in the YYYY-MM-DD format and you can sort them the way you wanted.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
In reply to Re: Get most recent data based on a date from an array of hashes.
by choroba
|
|