in reply to XML::Twig parsefile_inplace misunderstanding
At first glance it looks like a bug in XML::Twig, but if you see the test suite you'll see the use-case, XML-Twig-3.44-new/t/test_3_26.t
XML::Twig->new( twig_handlers => { bar => sub { $_->set_tag( 'to +to')->flush; }}) ->parsefile_inplace( $file, '.bak');
The call to flush does printing (as well as eating of the tree), which you don't have
If you add twig_handlers => { _all_ => sub { $_[0]->flush } } you'll get what you're after
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: XML::Twig parsefile_inplace misunderstanding (xml_pp twig_handlers _all_ flush)
by Discipulus (Canon) on Jul 19, 2013 at 09:27 UTC | |
by Anonymous Monk on Jul 19, 2013 at 09:57 UTC |