The following works for me:
my $tt = Template->new; $tt->process( \"[% IF foo == bar %]blah[% END %]", { foo => 42, bar => 42 } );
This displays a blah. Therefore, I suspect that your two variables do not contain what you think they are doing. The Template Toolkit uses string equality for == , so if you do:
my $tt = Template->new; $tt->process( \"[% IF foo == bar %]blah[% END %]", { foo => 42, bar => "42 " } );
He will break. You may need to massage the data a bit to make it work correctly with row equality.
source share