in reply to Sorting sub pains...

You're doing just fine. In-lining the sort block is usually the way to go.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.