http://www.perlmonks.org?node_id=924898

capriguy84 has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to construct a Hashes of Hashes of Arrays like below.
%HoH = ( flintstones => { lead => "fred", pal => "[ "george", "jane", "elroy" ], }, jetsons => { lead => "george", wife => [ "george", "jane", "elroy" ], boy => [ "george", "jane", "elroy" ], }, simpsons => { lead => "homer", wife => [ "george", "jane", "elroy" ], kid => [ "george", "jane", "elroy" ], }, );
I tried to use below code, but it resulted in creating multiple same-key-values and did not actually create an array. What am I doing wrong?
$HOH{$key}{"name"} = $value; push(@{$HOH{$key}{"price"}}, $value2);