A hash consists of a series of scalar to scalar mappings. When you assign a hash to the scalar $hashList->{$count}, Perl detects you are using the hash in scalar context, and hence returns the hash's bucket information. If you really want to generate a nested structure, you need to use hash references, not hashes, a.k.a. $hashList->{$count} = \%secondHash; See perllol, perlref and perlreftut for more info.
In reply to Re: Insert a new key (that is a hash) to a hash
by kennethk
in thread Insert a new key (that is a hash) to a hash
by eduardoll
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |