in reply to something like switch(case) in Perl

You might want to use another hash with the same keys, and code references as values:
my %actions = ( CC => sub { print "My name "; p_CC(); }, AB => sub { print "AB "; p_AB(); }, CD => sub { print "My friend "; p_CD(); }, ); for (keys %house) { $actions{$_}->(); }

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;