Why is the output filehandle not in scope? If it is available when you create the twig, you should be able to use it in the handlers (you can use a closure to pass it to the handlers). You could also use select to send all output to the filehandle, even though I would consider not so good for the maintenability of the code.
Finally, if you are using the latest version of XML::Twig, you don't need the final flush, it's done automagically.
In reply to Re^2: XML::Twig outputting root element start tag twice
by mirod
in thread XML::Twig outputting root element start tag twice
by benizi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |