http://qs1969.pair.com?node_id=179571

c has asked for the wisdom of the Perl Monks concerning the following question:

Okay, last XML::Simple question for a while, I promise.
I am messing around with nested containers and I am not sure how to call a container that doesnt have a "key" assigned.

<global> <snmp> <version>2c</version> <community>public</community> <retries>2</retries> </snmp> <node id="10.6.21.1"/> <node id="10.6.21.2"/> </global>

With the above xml info, I wanted to do something like

my $i = XMLin("filename",forcearray => 1); print "$i->{snmp}->{version}\n";

This doesn't work, and actually causes the processor to spiral upward until the process is killed. I am sure that I could do something like

<snmp version="2c"> <retries>2</retries> <community>public</community> </snmp>

But I really prefer the nested approach. I'm not sure how to approach this one. Is what I am trying to do feasible?

thanks -c