in reply to Custom Sort An AoA
my @list = sort { @$a <=> @$b or join(' ', reverse @$a) cmp join(' ', reverse @$b) } @input;
Does that fit the bill? Seems like my understanding of the spec is inconsistent with the other implementations, so I don't know if I've missed something.
If the array operations turn pricey, you could optimize with an Orcish Maneuver.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Custom Sort An AoA
by Limbic~Region (Chancellor) on Apr 01, 2014 at 17:28 UTC | |
by SuicideJunkie (Vicar) on Apr 01, 2014 at 17:43 UTC | |
by LanX (Saint) on Apr 01, 2014 at 18:42 UTC | |
by Limbic~Region (Chancellor) on Apr 02, 2014 at 12:11 UTC | |
by Limbic~Region (Chancellor) on Apr 01, 2014 at 17:54 UTC | |
by shmem (Chancellor) on Apr 02, 2014 at 08:20 UTC | |
by Limbic~Region (Chancellor) on Apr 02, 2014 at 12:07 UTC | |
by kennethk (Abbot) on Apr 02, 2014 at 18:09 UTC | |
Re^2: Custom Sort An AoA
by SuicideJunkie (Vicar) on Apr 01, 2014 at 17:31 UTC | |
by kennethk (Abbot) on Apr 02, 2014 at 18:13 UTC |