I'm pointing this out even though you hinted at it. The reason the sort is so much faster with <=> is because perl thinks the two strings are equal and with all elements in a list being equal no swaps have to be made when sorting and with perl's sort algorithm less comparisons have to be made.