MidLifeXis has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTML::Template - HTML_TEMPLATE_ROOT - multiple paths?
by freakingwildchild (Scribe) on May 01, 2007 at 21:44 UTC | |
by MidLifeXis (Monsignor) on May 02, 2007 at 14:27 UTC | |
by freakingwildchild (Scribe) on May 02, 2007 at 15:34 UTC | |
|
Re: HTML::Template - HTML_TEMPLATE_ROOT - multiple paths?
by scorpio17 (Canon) on May 02, 2007 at 15:00 UTC |