I have encountered a bug when cloning a XML::LibXML::Document instance. (Stackoverflow)
It is very easy to reproduce:
use strict; use warnings; use Clone 'clone'; use XML::LibXML; my $dom1 = new XML::LibXML::Document; my $dom2 = clone $dom1;
This crashes with "PmmREFCNT_dec: REFCNT decremented below 0 for nnnnnnn!.", at least with the standard Debian stable perl v5.14.2, using both Debian stable's XML::libXML v2.001 and CPAN's v2.0116.