in reply to Beginners question: assigning a variable as the name of a hash

# Doesn't delete anything else in the %{$data{$name}} $data{$name}{$key} = $keyvalue; # Erases everything else in the %{$data{$name}}. %{$data{$name}} = ( $key => $keyvalue );

It's bad to actually create variable dynamically. (You can see the reason for that here.) That's why I'm not creating a variable named %hash1. Rather, I created %data which hold %hash1 and any other hashes you wish to create dynamically.

  • Comment on Re: Beginners question: assigning a variable as the name of a hash
  • Download Code