in reply to Hash problem: each() failure

The error is at the top of your code:

my %Cls = {'P','a','N','b','U','c'};

You need to assign a list, not a hash reference to your hash:

my %Cls = ('P','a','N','b','U','c');