Re[2]: [Templates] Can't comparing strings (strings are treated as numbers)

[prev] [thread] [next] [Date index for 2004/12/27]

From: Oleg Burlaca
Subject: Re[2]: [Templates] Can't comparing strings (strings are treated as numbers)
Date: 10:07 on 27 Dec 2004
> The problem is solved in TT3's superior parser which only looks for
> operators where operators are expected, and doesn't require them to be universally reserved words.
Ok, now I understand why they are not in the core.

>> maybe it involves to hack the parser a lot ?
>
> Nope, it's easy.  Just add the following lines to Template::Grammar,
> around line 64:
thanks,  but  I'll  rather  pass  reference to lt, gt in $vars to template than modify the
sources (there will be problems with commercial hostings)


> %CMPOP = qw(
>    != ne
>    == eq
> ...
Ha, that's why '==' works with strings :)

Thanks.


_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

Re[2]: [Templates] Can't comparing strings (strings are treated as numbers)
Oleg Burlaca 10:07 on 27 Dec 2004

Generated at 08:56 on 15 Mar 2005 by mariachi v0.52