#!/usr/bin/perl -w use strict; use Data::Dumper; my @roster; push (@roster, {'parentname' => "bob Smith", 'kid_names' => ["little bobby","big bill"], }); push (@roster, { parentname => "mary Jane", childern => [ { name => "little sue", favcolor => "blue" }, { name => "big bertha", favcolor => "green" }, ], }); print "roster field names for 2nd entry:\n"; foreach my $field (keys %{$roster[1]}) { print " $field\n"; } print "\nthe names of the children for this parent:\n"; foreach my $href( @{$roster[1]{'childern'}} ) { print " $href->{'name'}\n"; } print Dumper \@roster; __END__ Prints: roster field names for 2nd entry: parentname childern the names of the children for this parent: little sue big bertha $VAR1 = [ { 'kid_names' => [ 'little bobby', 'big bill' ], 'parentname' => 'bob Smith' }, { 'parentname' => 'mary Jane', 'childern' => [ { 'favcolor' => 'blue', 'name' => 'little sue' }, { 'favcolor' => 'green', 'name' => 'big bertha' } ] } ];