in reply to Hash of hashes assignment
In the second, you have a scalar assignment of %hash to %hashOfHashes with key value $value. In scalar context, a hash returns information about how many buckets are available and filled. If you have a hash with 4 key-value pairs, you might get 4/8 returned -- 8 buckets allocated with 4 filled.
The third permutation here, and maybe what you want, would be $hashOfHashes{ $value } = \%hash; This stores a reference to %hash in %hashOfHashes with key value $value.
For more info, see perldsc. Also relevant: perldata, perlref, perlreftut, perllol...
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Hash of hashes assignment
by Anonymous Monk on Apr 12, 2013 at 16:31 UTC |