Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Problem with symbolic deferencing into XML::Simple's internal representation of an XML file.by Rhose (Priest) |
on Dec 05, 2001 at 20:58 UTC ( [id://129656]=note: print w/replies, xml ) | Need Help?? |
First off, the code I am attaching is not pretty, and there may well be a LOT better way of doing this, but I hope I am at least on the right track.
Also, I noticed in your code, you referenced tel_no, but the XML file has tel_num... I will assume tel_num is correct. I also noticed the following was probably a typo:
as the string "config->{jane}->{tel_no}" was not correctly terminated. Anyway, here is my first pass, please let me know if this helps/does not help. (I whimped out and used recursion. *Smiles*)
The code I used to test was:
Notice this "solution" requires you to change how you are calling the perl code -- instead of building the "perlish" string, you list the hierarchy separated by commas. Am I off base here, or is this what you wanted? Update: Might want to change the following line so the recursive sub is called one time fewer.
In Section
Seekers of Perl Wisdom
|
|