in reply to Sorting data problem

<=> is a numeric comparison operator. Use cmp instead, which sorts the strings alphabetically. If case is not important, use { lc($a) cmp lc($b) } for your sort.