Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: need help with xml parser

by Neighbour (Friar)
on May 23, 2012 at 08:24 UTC ( #971980=note: print w/ replies, xml ) Need Help??

in reply to need help with xml parser

If the name is in $data->{name} then your 2nd bit of code starts off right ($name = $data->{name}) but the print-command afterwards isn't. Try print "$name is $data->{age} years old.\n"
Suppose $data->{name} contains the name 'Jos'. When you're storing that in $name, the print-statement tries to access $data->{Jos} which is very unlikely to exist in your XML-data. So your code probably doesn't print a name at all.

Comment on Re: need help with xml parser
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://971980]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2015-11-26 01:01 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (695 votes), past polls