in reply to Insert a new key (that is a hash) to a hash
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.
|
---|