in reply to Re^4: How can I sort this data on the fourth field?
in thread How can I sort this data on the fourth field?

You've put an extra line in. Remove the chomp ( my @data = <$fh> ); line