in reply to Excel in Perl
Excel thinks that some or all of the cells in the column you are trying to sort are merged. Perhaps you set up a heading with merged cells? To get the sort to work, you can either split all of the cells in the column or merge all of the cells in the column.
However, to echo halley's point, perhaps you should consider taking a different approach to generating your files. Have you looked into Spreadsheet::WriteExcel?
In Section
Seekers of Perl Wisdom