in reply to Template newbie question. Is it lack of understanding or lack of DWIM

TT3 will allow you to use a "|" wherever you use a "." now. It will also unify simple filters so that they will also work with the ".".

It is possible in TT3 when it comes, or it is possible in CGI::Ex::Template now.

use CGI::Ex::Template; my $t = CGI::Ex::Template->new; my $html = "Test: [% section|ucfirst _ '-' IF section %]\n"; $t->process(\$html, {section => "foo"}); $t->process(\$html, {section => ""}); __END__ prints: Test: Foo- Test:


In most cases CGI::Ex::Template is a drop in replacement for Template.

my @a=qw(random brilliant braindead); print $a[rand(@a)];
  • Comment on Re: Template newbie question. Is it lack of understanding or lack of DWIM
  • Download Code