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

Perhaps since $_data is undefined, the encoding detection software isn't happy with it? Why not try setting $_data to some XML and see what it does.

...roboticus

  • Comment on Re: error returned with XML::Simple or Data::Dumper

Replies are listed 'Best First'.
Re^2: error returned with XML::Simple or Data::Dumper
by Anonymous Monk on Jul 17, 2010 at 19:32 UTC
    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

      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