Can we not check for definedness under STRICT in TT?

Here's my test program that blows up:

$ cat foo.pl
#!/usr/bin/perl

use strict;
use warnings;

use Template;

my $template = <<'END';
Hello, [% name.defined ? name : 'unknown person' %]
How are things in [% town.defined ? town : 'your town' %]?
END

my $tt = Template->new( { STRICT => 1 } );

$tt->process( \$template, { name => 'Dave', town => undef } ) or die 
$tt->error, "\n";

$ perl foo.pl
var.undef error - undefined variable: town.defined

This seems wrong to me, and this post by RJBS 
(http://rjbs.manxome.org/rubric/entry/1995) seems to verify it.

Is there something we're missing?

Thanks,
xoa

--
Andy Lester => www.petdance.com

_______________________________________________
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to