in reply to Problem traversing nested nodes XML::Simple
When you enable:
as you always should and have a look to the Data::Dumper output you see that $library->{place} returns an array of hashrefs not a single hashref. This is you problem. You can start with changinguse strict; use warnings;
toforeach my $key ( keys %{$library->{place}} ) {
foreach my $place ( @{$library->{place}} ) { foreach my $country ( @{$place->{country}}) { if ($country eq 'SouthAfrica') {
|
|---|