[htmltmpl] HTML::Template::Plugin::Dot method call fails
Brought to you by:
samtregar
From: Dan H. <dan...@re...> - 2005-10-13 01:08:52
|
Hi all, First off, apologies if this is not the correct place to discuss HTML::Template::Plugin::Dot - if there is an alternative, please let me know. I came across a problem when I tried using = CGI::Application::Plugin::HTDot - I couldn't use a parameter with a dot in its name as per the HTML::Template::Plugin::Dot examples. Instead I get: Bare word 't.name' not allowed in argument list to 'greeting' in dot expression 't.greeting(t.name)' at /usr/local/lib/perl5/site_perl/5.8.0/Class/Trigger.pm line 51 I wondering if I misunderstand the ability to supply dotted parameters = to method calls. I've come up with a simple case that illustrates my = problem below Regards Dan --code-- package Test; use strict; sub name { my $self =3D shift; $self->{name} ||=3D shift; return $self->{name}; } sub greeting { my $self =3D shift; my $name =3D shift; return "hello $name"; } sub new { my $class =3D shift; bless {}, $class; } 1; use HTML::Template::Pluggable; use HTML::Template::Plugin::Dot; my $text =3D '<tmpl_var t.greeting(t.name)>'; my $test =3D Test->new(); $test->name('bob'); my $template =3D HTML::Template::Pluggable->new(scalarref =3D> \$text); $template->param('t' =3D> $test); print $template->output; |