Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://971980]
help
Chatterbox?
[Cosmic37]: how big was @stuff corenth?
[Cosmic37]: Fast Artificial Neural Network (FANN) is cross-platform open source programming library for developing multilayer feedforward Artificial Neural Networks
[corenth]: @stuff was pretty big. I think it grew to about 8000.
[corenth]: each element was several three + element references
[corenth]: That FANN thing sounds like something I
[Cosmic37]: When I say I like LGPL what I mean is that I like the GPL aspect. I am a fan of Rishard Stallman and the Free Software Foundation but I wish I could be more virtuous... self-flagellates
[corenth]: . . . I'd like to play with
[corenth]: I'm a pragmatic free-software advocate. I'll play in a walled sandbox when I need to.

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2018-02-20 18:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (274 votes). Check out past polls.

    Notices?