# 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.
In reply to Re: Beginners question: assigning a variable as the name of a hash
by ikegami
in thread Beginners question: assigning a variable as the name of a hash
by Commander Salamander
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |