http://www.perlmonks.org?node_id=997120


in reply to Re^4: XML::Twig - provide additional parameters to twig_roots handlers
in thread XML::Twig - provide additional parameters to twig_roots handlers

The problem with adding own fields into the hashref is that you might unintentionally step over something. Or have an update to the module break your script, because the module starts using some key you added. That's why I specifically reserved $parser->{pad} as a place for user defined data attached to a parser and $parser->{parameters} as a place where you can find the additional parameter passed to the $parser->parse() call in XML::Rules.

Agreed on the closure being the cleanest way.

Jenda
Enoch was right!
Enjoy the last years of Rome.