Hi,
I've been trying to use the STRICT config option so that I know when I
am attempting to use an undefined template variable. Unfortunately,
there are instances when I need to test whether a variable is defined
before I use it (e.g. to test whether a DBIC schema object has any
related schema objects).
I have tried the following:
[% IF myvar %]
[% IF defined(myvar) %]
[% IF myvar.defined %]
All of which throw a var.undef exception. Is there any way to test
whether a variable is defined when using STRICT?
I have also tried using a subclassed Stash with undefined() overridden
to warn instead of die, but got unpredictable results (e.g. I can't see
$self->{_STRICT}, warnings about the component and loop variables
being undefined, etc).
Regards,
Dan Gardner
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates