Subject: | There is no way to negate a value for boolean tests |
I was trying to do something like <TMPL_IF EXPR="this && !that"> and
found I couldn't do it!
Here's a patch that adds a not() function that will negate its argument:
<TMPL_IF EXPR=<this && not(that)">
Adding a unary operator to the grammar to support !that is a bit more
involved than I'm ready for.
Subject: | expr.diff |
--- Expr.pm.orig 2008-06-13 17:33:50.000000000 -0400
+++ Expr.pm 2008-06-13 16:05:18.000000000 -0400
@@ -79,6 +79,7 @@
'hex' => sub { hex($_[0]); },
'int' => sub { int($_[0]); },
'log' => sub { log($_[0]); },
+ 'not' => sub { not($_[0]); },
'oct' => sub { oct($_[0]); },
'rand' => sub { rand($_[0]); },
'sin' => sub { sin($_[0]); },