On Tue, 19 Mar 2002, Cory Trese wrote:

> Would anyone else find a use for HTML::Template only comments?  In
> ColdFusion, a secondary form of comments is available for
> 'developer-eyes-only' that allows somewhat more sensitive data to be stored
> in the template files (granted 'more sensitive' is a highly relative term.)

It's easy to do this kind of thing with a filter.  Example:

  my $filter = sub { $$_[0] =~ s!<tmpl_comment>.*?</tmpl_comment>!!gs; }

  $t = HTML::Template->new(filename => foo.tmpl,
                           filter => $filter);

Then in your template:

  <tmpl_comment>...</tmpl_comment>

To make this easy to use multiple times just subclass HTML::Template and
override new() to add your filter before calling HTML::Template->new().
See HTML::Template::Expr for an example of a module that does this.

-sam



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

Reply via email to