HTML::Template::Plugin::Dot method call fails

"Dan Horne" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.html-template
Organization Redbone
Message-ID <000001c5cf92$a951c390$6403a8c0@rdbxp01>
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 = shift;
    $self->{name} ||= shift;
    return $self->{name};
}

sub greeting {
    my $self = shift;
    my $name = shift;
    return "hello $name";
}

sub new {
    my $class = shift;
    bless {}, $class;
}

1;

use HTML::Template::Pluggable;
use HTML::Template::Plugin::Dot;

my $text = '<tmpl_var t.greeting(t.name)>';

my $test = Test->new();
$test->name('bob');

my $template = HTML::Template::Pluggable->new(scalarref => \$text);
$template->param('t' => $test);

print $template->output;



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.