Tinkering a bit with the code in the original post
use strict;
use warnings;
my @fooFeatures = (
{ 'Baked Goods' => [ { 'Cookies' => ['Chocolate Chip', 'Oreo'] },
]},
{ 'Fruits' => [ { 'Apples' => ['Fuji', 'Granny Smith'] },
{ 'Oranges' => ['Tangerine', 'Navel'] },
]},
);
for my $fooSet ( @fooFeatures ) {
while (my ($key, $value) = each(%$fooSet)) {
for my $hash ( @{$value} ) {
while (my ($k, $v) = each(%$hash)) {
for my $feature ( @{$v} ) {
print "$key => ( $k, $feature)\n";
}
}
}
}
}
prints out:
Baked Goods => ( Cookies, Chocolate Chip)
Baked Goods => ( Cookies, Oreo)
Fruits => ( Apples, Fuji)
Fruits => ( Apples, Granny Smith)
Fruits => ( Oranges, Tangerine)
Fruits => ( Oranges, Navel)