What came to my mind was to use Data::Table. It will import from a CSV, can handle a header row, and it can sort by one or more columns. If I understood your post correctly, then it looks like this module will do everything that you're wanting to do.
In reply to Re: Help Sorting a CSV File
by dasgar
in thread Help Sorting a CSV File
by NorthernFox
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |