in reply to Different Type of Hashes
Example 2 has an 8 element list on the RHS of the assignment. When turned into a hash, you end up with a 2 element hash, as the keys are repeated.
Example 3 has a 2 element list on the RHS of the assigment, each element a reference to a hash. The second reference will survive the assignment to a hash, but the first will be stringified as the key.
I don't know what you want; the closest I can think of is an array of hashes:
Perhaps you want a two level hash, but none of the examples gives any clue as what the top level keys should be.my @h = ({1 => "j", 2 => "b"}, {1 => "p", 2 => "b"});
|
---|