in reply to Re: error returned with XML::Simple or Data::Dumper
in thread error returned with XML::Simple or Data::Dumper

Sorry, this is in a sub routine, and $_data is passed to the subroutine... so it is not undefined...

I have it write to a debug file and here is an example of it, I only changed the private data...

Data Received: " <?xml version = "1.0"?> <response> <status>success</status> <cardnumber>4141414141414141</cardnumber> <balance>1872.39</balance> </response> " XML Parser Parsed it into: $VAR1 = { 'balance' => '1872.39', 'cardnumber' => '4141414141414141', 'status' => 'success' };
So, I know it is getting data passed to it.

Richard

Replies are listed 'Best First'.
Re^3: error returned with XML::Simple or Data::Dumper
by derby (Abbot) on Jul 17, 2010 at 21:32 UTC

    Your $_data contains data in a character encoding that XML::SAX::PurePerl knows nothing about. Where are you getting $_data from? Is it UTF-8? ASCII? Some other charset? Is the charset being mangled about along the line? I couldn't see how to specifically tell XMLin which charset to use.

    -derby
      UTF-8

      Richard
        some xml parsing modules are more strict than others with regards to well formed and valid xml file etc. in your case i think you need to specify the encoding to be sure it's parsed
        <?xml version="1.0" encoding="ISO-8859-1" ?>
        or whatever encoding you desire.
        the hardest line to type correctly is: stty erase ^H