in reply to Question regarding hash with multiple values

Based on toolic's link and with your data as example:

>perl -wMstrict -MData::Dump -le "my %HoAoH = ( 'People' => [ { 'name' => 'Bob Dole', 'address' => '123 peach st.', 'spouse' => 'Bill Clinton', 'father' => 'Frank Dole' }, { 'name' => 'Al Pacino', 'address' => '123 orange st.', 'spouse' => 'Robert Deniro', 'father' => 'Marlon Brando' }, ], ); ;; dd \%HoAoH; ;; print $HoAoH{People}[1]{name}; print $HoAoH{People}[1]{address}; " { People => [ { address => "123 peach st.", father => "Frank Dole", name => "Bob Dole", spouse => "Bill Clinton", }, { address => "123 orange st.", father => "Marlon Brando", name => "Al Pacino", spouse => "Robert Deniro", }, ], } Al Pacino 123 orange st.

Replies are listed 'Best First'.
Re^2: Question regarding hash with multiple values
by locked_user sundialsvc4 (Abbot) on Jul 10, 2013 at 12:18 UTC

    n.b. Pay particular attention to the square brackets that appear in the above code-sample, vs. your original post.   It does not matter that the word People is or isn’t in-quotes ... what does matter are the square-brackets indicating an array of (in this case) hash-references.

    Perl data structures can become quite intricate because you can certainly have more than one reference to the same hash (or whatever-it-is).   You can do things similar to indexes in an SQL database, quite easily ... effectively, one piece of data is “in more than one place at one time.”   As long as you mind your P’s and Q’s ...