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

Re: Script stopped working...

by hippo (Bishop)
on Mar 18, 2018 at 08:20 UTC ( [id://1211178]=note: print w/replies, xml ) Need Help??


in reply to Script stopped working...

$content = $ua->request($req); my $data = $xml->XMLin($content);

This is a bug. $content in this context is an HTTP::Response object, not something which can be blindly passed to XMLin() successfully. You first need to extract the XML from it. eg. by using decoded_content. I'd therefore refrain from calling the response $content in the first place.

Try replacing those two lines with:

my $response = $ua->request ($req); my $content = $response->decoded_content; my $data = $xml->XMLin ($content);

That ought to get you a little bit farther along at least.

Replies are listed 'Best First'.
Re^2: Script stopped working...
by gentoobob (Novice) on Mar 18, 2018 at 17:20 UTC

    Yep! Wow. I figured I was missing some kind of decoding which is why I was trying to mess around with Data::Dumper but I couldn't get anywhere with it. This works! Thank you so much. Ive been trying to fix this script for 2 weeks now and putting serious time into. Thank you again.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-26 05:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found