Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Strange XML error

by xyzzy (Pilgrim)
on Aug 13, 2012 at 19:23 UTC ( #987187=note: print w/replies, xml ) Need Help??


in reply to Strange XML error

I don't know anything about this particular module, but the error says very clearly that $answers->{answer} is not an arrayref. This could be because the parser only returns an array of elements when there is more than one element (which would make sense in some cases). Sometimes functions can be forced into returning arrays by using them in list context. Try using Data::Dumper to see exactly what $answers->{answer} is. Read the docs for XML::Simple, they will probably tell you (unless they really suck) what kind of data structure XMLin returns.


$,=qq.\n.;print q.\/\/____\/.,q./\ \ / / \\.,q.    /_/__.,q..
Happy, sober, smart: pick two.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2021-04-21 07:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?