in reply to Using the value of a scalar as a hash

The exact answer to your question is to wrap this code in a block with strict refs turned off:
{ no strict 'refs'; foreach (qw/hasha hashb hashc/) { @keys = keys %$_; print "There are @keys here"; } }

But the better answer is a question: why are you doing this? Why not just store the data in one hash to begin with, for example $hash{a}{key1} instead of $hasha{key1}?