There is a problem in your new
statement: keep_encoding
and keep_atts_order
parameters are declared as twig_handlers
. I don't think that's what you want, since the only thing this does is to die as soon as an element named keep_atts_order
or keep_encoding
is found in the XML.
I think this is more like what you had in mind:
my $xml_twig_content = XML::Twig->new( keep_atts_order => 1,
keep_encoding => 1,
pretty_print => 'indented',
);