in reply to Re: Sorting dates with the Schwartzian Transform
in thread Sorting dates with the Schwartzian Transform
Schwartzian, no doubt, but not enough transformation. The dates are originally in DD-MM-YYYY format and must be rearranged for effective sorting.
@dates = map { $_->[0] } sort { $a->[1] >= $b->[1] } map { my $f = $_; /(\d\d)-(\d\d)-(\d{4})/g; [ $f, "$3$2$1" ] } @dates;
Also, incomplete. There are 3 other columns that should figure in the sort. I'd like to see the OP's code.
On a side note, I had never heard of the ST before. I looked briefly in perlsyn to see how I would know that the map {} sort {} map {} would be executed in reverse order, but I didn't find it. Any clues?
In Section
Seekers of Perl Wisdom