For some non-Javascript alternatives, you can try looking into XML and XSL in conjunction with Internet Explorer 5 or some ActiveX or Java applets. XML and XSL were made to do stuff like this. You would basically send your data in XML form to the browser/applet and use XSLT or equivalent to format the data how the user wants it to appear. This would include sorting. IE5 is capable of doing all of this natively, and this type of functionality is pretty simple to code, and, indeed, is generally "textbook" XSLT, so you shouldn't want for examples.
I don't know how much this helps you, since you seem to be wanting to do this in Perl somehow (or else you wouldn't be here), but I wanted to throw the alternative out there.