managing multiple TT2 scalar/list/hash ops
E R <[email protected]> Wed, 13 Feb 2013 13:06:22 -0600
| Newsgroups | gmane.comp.lang.perl.modules.template-toolkit |
|---|---|
| Message-ID | <CA+QY9tvH7HbqVavM+7aepAFG8AWtA3aYJOtfeZ8fy7EJQzDFNQ@mail.gmail.com> |
Suppose in your app your want to manage two different sets of
$Template::Stash::SCALAR_OPS, $Template::Stash::LIST_OPTS and
$Template::Stash::HASH_OPS. I.e. before each run of ->process() you might
want to set up these hashes differently.
What's the best way to do this? use local()?
{
local $Template::Stash::SCALAR_OPS = ...;
local $Template::Stash::LIST_OPTS = ...;
...
my $error = $tt2->process(...);
}
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates