in reply to Confused on handling merging values for hash of hashes
The confusion may arise from the fact that those things which you have called %HOH are not hashes of hashes but arrays of hashes (strictly arrayrefs of hashes). You should not try to create them with the % sigil since they are refs. So, if you said:
$aref = [ { key => 1, person => "Mike", possession => "wallet, keys, car, house, dog, cat, baseball bat" +, age => 25, }, { key => 3, person => "Dave", possession => "pony, house, car, keys", age => 21, }, ];
then you could print (or even just refer to) the possession of the second element like so:
print $aref->[1]->{possession};HTH
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Confused on handling merging values for hash of hashes
by Eily (Monsignor) on Feb 04, 2015 at 13:56 UTC |