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

In reply to Re: XML::twig using a hash in twig_roots by GrandFather
in thread XML::twig using a hash in twig_roots by bladestonight

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.