![]() |
|
The stupid question is the question not asked | |
PerlMonks |
Looping through nested repeated elements using XML::Simpleby ranjan_jajodia (Monk) |
on Dec 13, 2006 at 06:43 UTC ( [id://589498]=perlquestion: print w/replies, xml ) | Need Help?? |
ranjan_jajodia has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I am trying to loop through nested repeated elements in my config file but I am unable to find the number of nested elements: Sample XML File:
Perl Code: On running I always get the size as 1. I think the way I am trying to get the size is wrong because in order to get the person blocks I need to do $config->{person}->[0] etc. instead of $config->{person}[0]. I admit I have not used hashes earlier but I did try keys function on $config->{person} which gives "Type of arg 1 to keys must be hash (not hash element)" error. Could anyone please tell me the right way to loop through the elements? Regards, Ranjan
Back to
Seekers of Perl Wisdom
|
|