in reply to Dynamically naming and creating hashes

When indexing a hash, use $, not %.
foreach (@hashNames) { ${$_}{'key'} = $i; }
The above code is not equivalent to your example. The code below is.
foreach (@hashNames) { %{$_} = ( key' => '0' ); }