Quoting from the Template::Manual::Directives perldoc page on the DEFAULT directive:-
The DEFAULT directive is similar to SET but only updates variables that are currently undefined or have no "true" value (in the Perl sense).
The following seems to work though:-
[% UNLESS n.defined && n.length; n = 1; END %]In reply to Re: Template Toolkit, Default and Zero
by dtr
in thread Template Toolkit, Default and Zero
by marvell
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |