Hello,

were using the XML/Simple module to process a XML response using the code below. But for some reason the module can't read the $xmlresponse data unless we create a temp file first to store the data then pass that to the module. Is there a way to do this without having to create a temp file first. ?? Everything does work, the response is return. We used the Data/Dumper module to verify the data first.

=========================================================
my $ua  = new LWP::UserAgent;
  $ua->timeout(10);
  $ua->agent("HTTP/1.1");
my $req = new HTTP::Request 'POST' => "$xmlscript";
  $req->content_type("application/x-www-form-urlencoded");
  $req->content($xmlrequest);
my $res  = $ua->request($req);

my $error   = $res->is_error();
my $success = $res->is_success();

# Data returned in XML Format
my $xmlresponse = $res->content();

my $simple = new XML::Simple(KeyAttr=>[]);
# read XML file
my $xmldata = $simple->XMLin("$xmlresponse");
# can't read the response in this manner
===================================================

Thanks and happy holidays,

Mike(mickalo)Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
http://www.thunder-rain.com/
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to