XML::Simple Help?
- From: Vin Grover <grover037@xxxxxxxxxxxxxx>
- Date: Sat, 23 Apr 2005 16:09:29 -0500
I'm looking for a simple way to process results returned from a
website via XML. I was thinking XML::Simple should be simple... but
apparently I'm even simpler than it is!
I'm having trouble figuring out how to get at the four items it
returns. Looks like $tags contains a hash which is actually a data
structure named $VAR1, which appears to define a hash, but how do I
make it work? It looked empty, but Dumper shows the contents and they
look like exactly what I want... but how do I access it???
-----------------------------------
Test Code (response is copied from actual data):
#!/usr/bin/perl
use XML::Simple;
use Data::Dumper;
$content="<response>
<result>12</result>
<respmsg>Decline</respmsg>
<authcode>RE-PRESENTED CHK</authcode>
<pnref>99220</pnref>
</response>";
$tags = XMLin($content);
print "\n\nDumper:\n";
print Dumper($tags);
-----------------------------------
Results:
Dumper:
$VAR1 = {
'authcode' => 'LREADY USED',
'pnref' => '99220',
'respmsg' => 'Denied',
'result' => '12'
};
-----------------------------------
So... $tags contains what I'm looking for... now I need to be able to
use the four items!
Anyone?
.
- Follow-Ups:
- Re: XML::Simple Help?
- From: Vin Grover
- Re: XML::Simple Help?
- Prev by Date: Re: sound (playing few wavs at once)
- Next by Date: Re: XML::Simple Help?
- Previous by thread: sound (playing few wavs at once)
- Next by thread: Re: XML::Simple Help?
- Index(es):
Relevant Pages
|
|