I was recently testing whether a bug manifested with Template::Stash v
Template::Stash::XS and noticed this,
use Template;
use Template::Config;
#$Template::Config::STASH = 'Template::Stash';
package Foo;
sub new {
my $self = {};
bless $self, shift;
}
package main;
my $foo = Foo->new();
my $tt = Template->new();
my $template = "[% foo.bar = 0 %] [% foo.bar %]\n";
$tt->process(\$template, {foo => $foo})
or die $tt->error(), "\n";
__END__
This produces the expected "0" with ::XS (my default) but uncommenting
that line to use ::Stash produces,
undef error - Can't locate object method "bar" via package "Foo" at
/usr/local/lib/perl/5.10.0/Template/Stash.pm line 613.
So it seems to be seeing that foo maps to an object but ignoring
having set an attribute on it.
(This is latest TT)
Paul
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates