I have trouble visualizing loops and have what I think is an array of hashes of arrays. Please correct me if I am misunderstanding this. I want to be able to loop through the below array and print each key's value.
The End results would print the elements like so:
name
version
pop
tart
Unfortunately, I fall apart when I get to key three.
my @complex = (
[
{
one => 'name',
two => 'version',
three => [qw( pop tart )],
},
],
);
Here's what I've managed so far. I just don't know to handle key three within these loops.
for my $aref (@complex) {
for my $href (@$aref) {
for (keys %{$href}) {
print "$href->{$_}\n";
}
}
}
Any help would be appreciated.