http://www.perlmonks.org?node_id=971980


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.