in reply to Foreach hash of array
Using "foreach" or "grep" on a hash makes no sense. Tell us what you want to do, not how you want it to be done!
If want to enumerate the fruits in season (totally ignoring vegetables and fruits that aren't in season), you could use the following:
my $fruits_in_season = $xml->{Fruits}{Season}; for my $fruit_name (keys %$fruits_in_season) { my $fruit = $fruits_in_season->{fruit_name}; ... }
|
|---|