Hello,

I'm interested in a new feature in HTML::Template, and I want to see if
other folks would find it useful. 

H::T currently has two methods of handling global template variables:

1. Don't allow them. (the default)

2. Make all top level variables available everywhere. 

I'd like to propose an "in-between" functionality-- the ability to
declare the list of top level variables that I'd like to be global. My
"use case" is this: I like to make a lot of configuration variables
available in HTML::Template by default. I'd like a few, but not all of
them available everywhere in the template namespace. This prevents the
namespace pollution of the global variables I'm not going to use
globally and saves HTML::Template the processing power of not handling
these un-used templates. I can declare these variables in one place, (in
my case, my load_tmpl() function in CGI::App), and not worry about this
the rest of the time. 

I'm thinking the syntax would be allow the "global_vars" option to the
new() function to take a array reference as a value, like this:

global_vars => [qw/site_name site_url contact_email/],

Comments about this idea? 

  -mark

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to