⭐ in reply to How do I sort a list chronologically from most recent to last?
In this case, you should probably look into making a more advanced data structure with split or using substr in a more complex sort function. Something like this may work:
my @sorted = sort { substr($a, 0, 4) <=> substr($b, 0, 4) } @unsorted;
This code is untested, suitable only as an example of technique, not syntax.
|
|---|