in reply to Some advice regaring sorting and hashes

Your code:

sort keys { $a <=> $b } %hash
Is incorrect. Assuming the groups really look like "AA01" and "GF02", and assuming you want them in alphabetical order, and assuming these are in the hash %hash, this is what you want:
sort { $a cmp $b } keys %hash