An idea for a quick hack...
This will add the following operators to the template parser: ne, !=, and, or, =~, !~.
Assuming you already have the enhanced template support mod installed...
in sub parse, replace
with:
and after:
add:
($comp eq '!=') and ($result = ($self->{'vars'}{$var} != $val));
($comp eq '=~') and ($result = ($self->{'vars'}{$var} =~ $val));
($comp eq '!~') and ($result = ($self->{'vars'}{$var} !~ $val));
($comp eq 'and') and ($result = ($self->{'vars'}{$var} and $self->{'vars'}{$val}));
($comp eq 'or') and ($result = ($self->{'vars'}{$var} or $self->{'vars'}{$val}));--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com
This will add the following operators to the template parser: ne, !=, and, or, =~, !~.
Assuming you already have the enhanced template support mod installed...
in sub parse, replace
Code:
$line =~ s/((.*?)$begin\s*if(not)?\s+(.+?)\s*((<|>|lt|gt|eq|=)\s*["']?(.+?)["']?)?$end(.*))/Code:
$line =~ s/((.*?)$begin\s*if(not)?\s+(.+?)\s*((<|>|lt|gt|eq|=|ne|!=|=~|!~|and|or)\s*["']?(.+?)["']?)?$end(.*))/Code:
($comp eq '<') and ($result = ($self->{'vars'}{$var} < $val));Code:
($comp eq 'ne') and ($result = ($self->{'vars'}{$var} ne $val)); ($comp eq '!=') and ($result = ($self->{'vars'}{$var} != $val));
($comp eq '=~') and ($result = ($self->{'vars'}{$var} =~ $val));
($comp eq '!~') and ($result = ($self->{'vars'}{$var} !~ $val));
($comp eq 'and') and ($result = ($self->{'vars'}{$var} and $self->{'vars'}{$val}));
($comp eq 'or') and ($result = ($self->{'vars'}{$var} or $self->{'vars'}{$val}));
Free, hot camel soup for Links hackers...
http://www.camelsoup.com