Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: removing perldata , hashref from XML file (updated)

by haukex (Archbishop)
on May 18, 2020 at 08:26 UTC ( [id://11116888]=note: print w/replies, xml ) Need Help??


in reply to Re^2: removing perldata , hashref from XML file (updated)
in thread removing perldata , hashref from XML file

Can't handle Math::BigInt=HASH(0x22bcc10) (yet) at DECODEi.pl line 90407.

This error message is surprising in that Math::BigInt overloads stringification, and the error message should not be showing the object name like that. You'd have to show a SSCCE that reproduces this issue to investigate further.*

Given this, I don't know if the following will work in your case, but my code can be extended to support objects that overload stringification by adding the following to the top of the file, just under the other use statements:

use Scalar::Util qw/blessed/; use overload ();

And this just before the line "elsif ( ref $data ) { die "Can't handle $data (yet)" }":

elsif ( blessed($data) && overload::Overloaded($data) && overload::Method($data,'""') ) { newel($parent, @args)->appendText("$data") }

* Update: It can be explained if you're reading a dump of a Perl data structure into a script that doesn't load the corresponding module. In this case, my code above won't work either unless you load the module.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11116888]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-20 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found