Update:I think that I may have tried to generalize my original post too much, when I should have focused it explicitly on just HTML_TEMPLATE_ROOT. Please read this in the context of H::T and the HTML_TEMPLATE_ROOT variable.

I am running into a methodology question:

In particular, HT's HTML_TEMPLATE_ROOT variable only allows a single path. If you have a set of paths that you wish to search, you need to make sure to put the paths into the ->new() call for the template.

This may not always be possible or desireable.

Take, for example, a scenerio where you tie parts of a system together with environment variables. You pick multiple paths for certain versions of libraries, PERL5LIB for the same, and you also want to pick some templates from a set of choices. I can create a configuration file and point to that, but now my configuration is in two locations, the shell script script starting the whole thing (both perl and non-perl parts) and the second configuration file.

Additionally, if I require my HTML::Template->new call to include the path attribute, I now need to make sure that every call to ->new, including those that I do not have control over, allow me to tweak the include path.

On the down side, there may be a performance penalty if the search path on new is combined with a multi-path HTML_TEMPLATE_PATH environment variable.

There is also the potential for security issues if someone else can tweak your environment. But if that is the case, then PATH is also suspect.

Any thoughts on this? I am leaning heavily toward patching HT (and submitting it, of course), but am not sure if there are other implications.

--MidLifeXis


In reply to HTML::Template - HTML_TEMPLATE_ROOT - multiple paths? by MidLifeXis

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.