I need to sort an array of arrays; the .sort
method seems to work by
default. But what is a good way to sort by different indices of the
inner arrays?
The array to be sorted is outer larger array: (birthday in 'mmddyy' format)
my @allRecords = [ [birthday1 firstName1 lastName1 [data1]
[birthday2 firstName2 lastName2 [data2]
...
[birthdayN firstNameN lastNameN [dataN] ];
@allRecords.sort by itself sorts by birthdays.
What is a better way to sort by firstName or lastName or by data inside the inner arrays?
@a.sort: *[2...0]
– Milliard