Almost. Some of the templating modules (e.g., HTML::Template) will query all keys to compare to all the parameters in the template to make sure of a one-to-one match which I find equally annoying, but that's for another rant - the error message from the check is at least quashable. I'm unsure of whether the parameter that quashes the error message also quashes the check.

That said, HTML::Template also only takes a hash, not a hash ref, so your comment doesn't quite apply there - which modules take a hash ref? I would think that most modules wouldn't since they need to allow you to set the parameters multiple times to add new parameters from various sources. Yes, you could do that yourself and pass the whole thing in, but that's quite a bit less extensable. And then it would take the hash you give it, tied or not, and copy it into itself. It's sounding a bit more work than submitting patches to allow callbacks :-)


In reply to Re^2: Templating algorithm - pass in variables vs callback? by Tanktalus
in thread Templating algorithm - pass in variables vs callback? by Tanktalus

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.