in reply to XML::twig using a hash in twig_roots

First, welcome to the Monastery! Very nice first post.

"It isn't working" doesn't generally tell us a lot about what particular problem you are experiencing. Generally it helps to provide a little sample data and tell us what you saw and what you expected to see.

In this case it may be that the missing ')' in the $val .= ' },'; line is the problem. Try:

$val = "sub {upd_param (\@_, $val)},";

in place of the two lines. Not only is it more likely to work, but the intent is much clearer.

In a similar vein, there are many other ways that you could handle your configuration issue. The method you are using at the moment looks rather fragile non-intuitive. However I'd like to see a full working sample (provide the document to be processed in a __DATA__ section) before advising any alternative technique. Keep the sample data very short - you only need enough to demonstrate how things work (or don't).


DWIM is Perl's answer to Gödel