It works as far as you've gone. Adding some test data to your program gives us:
#!/usr/bin/perl
use strict;
use warnings;
my @aoaoh = (
[
{ a => 1, b => 2 },
{ c => 3, d => 4 },
],
[
{ a => 101, b => 102 },
{ c => 103, d => 104 },
],
);
for my $j (0 .. $#aoaoh) {
for my $aref (@aoaoh) {
print '"' . join('","', @$aref[$j]), "\"\n";
}
}
And running that gives:
$ ./aoaoh
"HASH(0x9c45818)"
"HASH(0x9c70c48)"
"HASH(0x9c60418)"
"HASH(0x9c70c08)"
So you've successfully navigated the two levels of arrays and you're just left with the hash references to dereference. Something like this perhaps:
#!/usr/bin/perl
use strict;
use warnings;
my @aoaoh = (
[
{ a => 1, b => 2 },
{ c => 3, d => 4 },
],
[
{ a => 101, b => 102 },
{ c => 103, d => 104 },
],
);
for my $j (0 .. $#aoaoh) {
for my $aref (@aoaoh) {
# print '"' . join('","', @$aref[$j]), "\"\n";
for (keys %{$aref->[$j]}) {
print "$_ -> $aref->[$j]{$_}\n";
}
}
}
Which gives:
$ ./aoaoh
a -> 1
b -> 2
a -> 101
b -> 102
c -> 3
d -> 4
c -> 103
d -> 104
Personally, I'd write it like this as I think it's easier to deal with elements than indexes.
#!/usr/bin/perl
use strict;
use warnings;
my @aoaoh = (
[
{ a => 1, b => 2 },
{ c => 3, d => 4 },
],
[
{ a => 101, b => 102 },
{ c => 103, d => 104 },
],
);
for my $aref (@aoaoh) {
for my $href (@$aref) {
for (keys %{$href}) {
print "$_ -> $href->{$_}\n";
}
}
}