use strict; use warnings; use feature 'say'; use Data::Dumper; my @arr = get_data(); say "Data:"; while ( my ($n, $aref) = each @arr ) { say " Aref: " . ($n + 1); while ( my ( $n, $href ) = each @{ $aref } ) { say " Href: " . ($n + 1); while ( my ( $key, $val ) = each %{ $href } ) { say " $key: $val"; } } } say '~~~~~~~~~~~~~~'; my @vals = map { $_->{'myKey'} } map { @{ $_ } } @arr; say "Inner values:"; say Dumper \@vals; sub get_data { my @arr; my @subArr1; my @subArr2; my %hash1 = ( myKey => 1 ); my %hash2 = ( myKey => 2 ); my %hash3 = ( myKey => 3 ); my %hash4 = ( myKey => 4 ); push(@subArr1, \%hash1, \%hash2); push(@subArr2, \%hash3, \%hash4); push(@arr, \@subArr1, \@subArr2); return @arr; } #### $ perl 1182753.pl Data: Aref: 1 Href: 1 myKey: 1 Href: 2 myKey: 2 Aref: 2 Href: 1 myKey: 3 Href: 2 myKey: 4 ~~~~~~~~~~~~~~ Inner values: $VAR1 = [ 1, 2, 3, 4 ];