in reply to Re: Re: Calling nested containers with XML::Simple
in thread Calling nested containers with XML::Simple
Now, consider XML::XPath, which 'drills down' to the nodes in question:for my $snmp (@{$i->{snmp}}) { for my $version (@{$snmp->{version}}) { print "$version\n"; } }
Much nicer. :)use XML::XPath; my $xp = XML::XPath->new(filename => 'filename'); my $nodeset = $xp->find('global/snmp/version'); print $_->string_value, "\n" for $nodeset->get_nodelist;
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|