|
We were not quite satisfied
with the .defined notation and default defined behavior when we started
using TT. Though returning an empty string for undefined values is nice for outputting simple HTML, it makes it difficult to check if values (including hash refs, array refs, and return values from plugin calls that wrapper existing perl code) are defined and change logic accordingly. Therefore, we created a simple sub-class of Template::Stash and implemented an undefined subroutine that returned undef instead of the empty string. In conjunction with another plugin that provides wrappers for simple perl functions it allows us to easily check if any variable is defined or not defined. This was easy to implement and worked nicely. With the arrival of Template::Stash::XS it would be nice to gain any performance increase offered. However, sublcassing Template::Stash::XS and creating an undefined subroutine does not have the same effect as it did when Template::Stash was subclassed. Is there a way to have the perl undef value returned for undefined variables when using Template::Stash::XS? Thanks Kerry |
- [Templates] Subclassing Template::Stash::XS Kerry DeZell
- Re: [Templates] Subclassing Template::Stash::XS Paul Seamons
