* Brian Katzung <bri...@kappacs.com> [2012-11-14 22:15]: > Here's what I would consider a typical use case for > Text::TemplateLite: "nicely" displaying the number of matches > returned by a query using Template and Text::TemplateLite: > > > # The Template Toolkit template: > my $tt_tpl = q{Your search returned [% IF m == 0 %]no matches[% > ELSIF m == 1 %]1 match[% ELSE %][% m %] matches[% END %].}; > > # The Text::TemplateLite template: > my $tl_tpl = q{Your search returned <<??(=($m, 0), 'no matches', > =($m, 1), '1 match', $m' matches')>>.}; > # (Substitute "ifel" for "??" if desired)
Q.E.D. > The T:TL syntax has the benefit of being easily "balance"-checkable > in an editor such as vim. “Non-programmers” “an editor such as vim”. I see. :-) Regards, -- Aristotle Pagaltzis // <http://plasmasturm.org/>