in reply to Generate Array of Hashes WITHOUT References
An array is a list of scalars. Hashes are not scalars. Ergo, arrays cannot contain hashes.
There are two workarounds if you want to store a hash in an array:
References are scalars. Therefore, you can store a reference to a hash in an array.
Strings are scalars. If you can serialize the hash into a string, you can store that in an array.
There is no #3, and it is almost always a terrible idea to choose #2 over #1.
Why exactly are you trying to avoid using references?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Generate Array of Hashes WITHOUT References
by tel2 (Pilgrim) on Sep 10, 2014 at 10:41 UTC |