in reply to Hash problem: each() failure
The error is at the top of your code:
You need to assign a list, not a hash reference to your hash:
my %Cls = ('P','a','N','b','U','c'); [download]