What do you mean by XS object? Objects created by XS code are no different than objects create by Perl code if they are visible to Perl.
And if you're talking about something that's not visible to Perl, then Perl can't help you.
Unfortunately, the beef of LibXML objects is not visible to Perl.
You could convert the LibXML objects to XML and store that in the cache. The objects need to be serialized anyway, so why not serialize them to XML.
# Store into cache
$cache->set( xml => $xml_doc->toString() );
# Fetch from cache
my $xml_doc = XML::LibXML->new()->parse_string( $cache->get( 'xml' ));
Update: Added possible solution.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.