note
choroba
Dates can be compared as strings if they follow the YYYY-MM-DD pattern (compulsory [https://xkcd.com/1179/|xkcd] reference).
<c>
sub mdy2ymd {
my ($mdy) = @_;
$mdy =~ /(..)-(..)-(....)/ and return "$3-$1-$2";
}
my @filtered = sort {
mdy2ymd($a->{Date}) cmp mdy2ymd($b->{Date})
} @$data;
</c><P>
For longer lists, you might want to use the Schwartzian transform so Perl doesn't have to convert each date several times.<P>
Better yet, store the dates directly in the YYYY-MM-DD format and you can sort them the way you wanted.<P>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-832495">
<c>map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]</c>
</div></div><!-- Wiki2Monks {"version":1.161} -->
11140571
11140571