The stupid question is the question not asked | |
PerlMonks |
Re^4: XML::Twig - provide additional parameters to twig_roots handlersby mirod (Canon) |
on Oct 03, 2012 at 12:34 UTC ( [id://997048]=note: print w/replies, xml ) | Need Help?? |
Well, the XML::Twig object is an old fashion hashref, and I have no plan to change this, so you can always add your own fields to it. Or use a "hidden" attribute (one which names starts with '#') to attach private data to any element, including the root. A closure is the cleanest way to go though. It's not a trick, it's just a common idiom. BTW, a google search on "XML::Twig passing data to handlers" (or using "arguments" instead of data) returns plenty of answers to that question.
In Section
Seekers of Perl Wisdom
|
|