Gaffer's Gotcha's
This might be helpful. What did I miss?
[% apple = 'green' %]
[% IF ( apple == 'green' ) %]
You might get confused
[% else %]
if you accidentaly use lower case keywords
[% END %]
[% IF ( apple = 'red' ) %]
Don't use = to test equality
[% END %]
[% hash.key = 'value' %]
[% IF ! hash.defined(key) %]
don't forget to quote keys for hash virtual methods
[% END %]
[% IF ! hash.defined("key") %]
This won't be printed
[% END %]
[% k = 'key' %]
[% IF ! hash.defined($k) %]
even if they are variables
[% END %]
[% IF ! hash.defined("$k") %]
This won't be printed
[% END %]
[% list.push( "This won't be printed" ) %]
[% list %]
[% list = [ "You must assign a list to a variable" ] %]
[% list.push( "before you can push onto it." ) %]
[% list.join(" ") %]
[% dictionary.sit = "To rest with the torso vertical and the body supported on the
buttocks" %]
[% IF (dictionary.size != 1) %]
This will not be printed
[% END %]
[% dictionary.six = "The cardinal number equal to 5 + 1" %]
[% IF (dictionary.size != 2) %]
This will not be printed
[% END %]
[% dictionary.size = "The physical dimensions, proportions, magnitude, or extent of an
object" %]
[% IF (dictionary.size != 3) %]
If you use a hash virtual method as a key, then you loose the virtual method.
[% END %]
Some things are difficult to illustrate:
If you INCLUDE a file that looks like an expression, perhaps because
it contains a dash or starts with a digit, then you'll want to quote it.
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.ourshack.com/mailman/listinfo/templates