I don't use stackoverflow much and couldn't comment there, which might have been more appropriate, but I took Ikegami's solution to your stackoverflow post and modified it just a little as below and the result seemed to do what you wanted with one pass.
my $tee = IO::Tee->new($frufile, $vegfile); my $twig = XML::Twig->new( ... etc. twig_print_outside_roots => $tee, ... ); $twig->parse( *DATA );
In reply to Re: Buggy output from XML::Twig on a Tee
by mr_ron
in thread Buggy output from XML::Twig on a Tee
by seki
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |