in reply to HTML::Template's watchful eye

I think it is the correct behavior. I think HTML::Template first compiles your template to some Perl code, and then executes it. If it can't find some include, open() will fail.

surrender to perl. your code, your rules.

Replies are listed 'Best First'.
Re^2: HTML::Template's watchful eye
by Tanktalus (Canon) on Jun 24, 2005 at 21:49 UTC

    Close. You're thinking of something more like Text::ScriptTemplate which compiles to perl code, then executes it.

    HTML::Template does "compile" the template, but to an internal data format which it then can save (to disk, shared memory, whatever). Since this phase doesn't look at the passed-in variables, it doesn't know that the if clause is false. It very well could be true next time, and next time we may not even look at the templates because we'll reuse the template that is pre-compiled, all for speed.

    And that's the overwhelming idea with HTML::Template - speed. It has many options on caching, just to try to get the right amount of speed from your system.