in reply to parsing a simple xml response
You want to do something simple with XML. How about XML::Simple? and one line of code:
#! perl -slw use strict; use Data::Dump qw[ pp ]; use XML::Simple; my $xml = XMLin( do{ local $/; <DATA> } ); pp $xml; __DATA__ <?xml version = "1.0"?> <response> <custid>101010101</custid> <status>success</status> <responsecode>11</responsecode> <kf></kf> <cn>1111222233334444555</cn> <neta>7.00</neta> <prid>X111111111111111</prid> <ano>22222222</ano> <trxid>33333333</trxid> <description>Transfer Completed</description> </response>
Output:
c:\test>junk4 { ano => 22222222, cn => "1111222233334444555", custid => 101010101, description => "Transfer Completed", kf => {}, neta => "7.00", prid => "X111111111111111", responsecode => 11, status => "success", trxid => 33333333, }
|
|---|