Hi,

I've noticed that Template Toolkit version 2.08 appears to be comparing
variables with 'eq' when one of the variables is a string.  However, this
seems to sometimes violate DWIM.  Is this a known issue, mentioned in the
docs (and I missed it), or is it a bug?

Below is a test case showing that Perl and Template Toolkit are returning
different results.  I've temporarily gotten around the problem by forcing
"int" variables to be numbers by adding zero, but it's a bit weird.

#!/usr/bin/perl -w
use strict;
use Template;

my $template = Template->new;
my %data = (
  foo => 3,
  bar => '03'
);

print "Perl results: ", $data{ foo } == $data{ bar }
  ? "match\n"
  : "no match\n";

$template->process( \*DATA, \%data );

__DATA__
Results:  [% IF foo == bar; 'match'; ELSE; 'no match'; END %]

--
Cheers,
Curtis Poe
Senior Programmer
ONSITE! Technology, Inc.
www.onsitetech.com
503-233-1418

Taking e-Business and Internet Technology To The Extreme!


_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://www.template-toolkit.org/mailman/listinfo/templates

Reply via email to