hello,

I tried to register a vmethod to an object using this way:

use strict;
use warnings;
use Template;
use Template::Stash;

$Template::Stash::SCALAR_OPS->{field} = sub {
    my $self = shift;
    $self->field(@_);
}

but it doesn't work: $self can't be a reference to be handled by
SCALAR_OPS.

I have 2 questions about it:

i use Template::Stash, so i guess that XS isn't used anymore in my
script so i lost performance. is it right? 

is it a way to handle a vmethod for an object without using USE or
declare anything (everything is done in the perl code)?
I just want something as simple as

[% notice.field('99'); %]

-- 
Marc Chantreux
BibLibre, expert en logiciels libres pour l'info-doc
http://biblibre.com

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

Reply via email to