nepzraaz has asked for the wisdom of the Perl Monks concerning the following question:
But the problem is that the attribute "name" has to be stored in a variable. So I have to write the second line like this:$data = $xml->XMLin("data.xml"); # access XML data print "$data->{name} is $data->{age} years old.
which is not working properly. I am using xml::simple to parse this file. Thanks for your suggestions.$name=$data->{name}; #reads the content of name print "$data->{$name} is $data->{age} years old.#goes to the value/att +ribute #pointed by $name
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: need help with xml parser
by sauoq (Abbot) on May 22, 2012 at 17:01 UTC | |
|
Re: need help with xml parser
by Neighbour (Friar) on May 23, 2012 at 08:24 UTC |