Okay shmem. That first sentence was always a mess, and correcting the grammer whilst leaving the structure intact didn't help much. Is this any better?
How sort actually works internally doesn't really matter. What does matter is that being built-in to the language, it understands Perl's internals, is always available and about as fast as you are likely to achieve.
s/the the/the/ should be s/the the/to the/. That I haven't noticed this before, having now read and re-read this dozens of times, does not surprise me. That many other pairs of eyes have looked right past this, does. Welcome to my world.
Corrections made. Thanks.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.