in reply to Re: Moving elements with XML::Twig: Document root closing tag is duplicated on output -- solution
in thread [SOLVED] Moving elements with XML::Twig: Document root closing tag is duplicated on output
There's nothing wrong with '/shipment/box' => sub { _move(@_); 1; }. This is perfectly valid code. It means, call _move with all my parameters, but always return 1 - and this is all wrapped up with a code reference (it's an anonymous, or unnamed, sub). That return code, if you read the XML::Twig documentation, is relevant: "If a handler returns a true value and other handlers apply, then the next applicable handler will be called." I'm not sure what other handler there is, but there may be something trying to flush again here that I'm not seeing. When you change the return value, you may be changing the calling of this other handler, and that may stop the flushing. However, since handlers are documented to have meaningful return codes, it's probably best if you provide said meaningful return code.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Moving elements with XML::Twig: Document root closing tag is duplicated on output -- solution
by Discipulus (Canon) on Feb 21, 2016 at 18:29 UTC |