Subject: | Template::Stash::define_vmethod() should be object method instead of class method |
I was looking at a Template::Plugin subclass that another developer had
written and was left wondering why the vmethod mappings are stored at
the class level in Template::Stash rather than being kept inside the
individual Template::Stash objects.
It seems like it would be more sensible to do something like:
my $stash = $context->stash();
$stash->define_vmethod('scalar', 'something', sub { ... });
Instead of
Template::Stash->define_vmethod('scalar', 'something', sub {...});