On Monday 11 September 2006 12:10 pm, Roderick A. Anderson wrote:
> Is there a method to increment a value and have it return that value?
> I've been through the Badger Book but didn't quite see what I was
> needing though MACRO seemed close.  This is for a View for a Catalyst
> based application if that makes a difference.

[% ++val %]
[% val++ %]
[% --val %]
[% val-- %]

Will be supported in TT3.  They are not available in TT2.  They are available 
in CGI::Ex::Template (part of CGI::Ex) which does the majority of TT2 and 
much of TT3.

[EMAIL PROTECTED] ~]$ perl -e 'use CGI::Ex::Template; 
CGI::Ex::Template->new->process(\"[% a++ %][% a++ %][% --a %]\n")'
011

Paul Seamons

_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to