Josh Rosenbaum <[EMAIL PROTECTED]> wrote:
> You can also use this probably: a.match("(?i)^$b\$")

Phil Mitchell wrote:
> I'm pretty sure that tt2 doesn't do variable interpolation in match().

It does, as this simple test illustrates:

[EMAIL PROTECTED]:~] tpage
[% foo = 'hello';
   bar = 'HELLO';
   foo.match("(?i)^$bar\$") ? 'match' : 'no match'
%]
^D
match

tpage is great for quickly testing syntax issues like that.

> The question that I'm stuck with is why my macro works when the test
> is in the same template where it's defined, and doesn't work from
> another template. 

Perhaps you need to PROCESS the macros.tt template, not INCLUDE it.
PROCESS exports all variables/macros/blocks defined to the caller,
INCLUDE doesn't.

HTH
A


_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to