in reply to hash : how to add values and keys dynamically

Not sure what do you want but maybe this will help:

my %hash; for (qw(a b c)) { push @{ $hash{key} }, $_ if 'this'; }