template-toolkit

Calling outside subs and modules in Template Toolkit without Plugins?

旧街凉风 提交于 2019-11-30 21:25:50
I am trying to call an outside Perl module in a Template Toolkit .tt file. The module I want to use is Util , and I want to call Util::prettify_date . I was able to include this module using Template Toolkit's plugin interface: I set up the load, new, and error function (as described here: http://template-toolkit.org/docs/modules/Template/Plugin.html ), and include it using [% USE Util %] . This works fine, but I was wondering if there's a way to USE Perl modules in Template Toolkit without having to plugin-ify them. The main issue with making plugins is that I have to make all the functions

Calling outside subs and modules in Template Toolkit without Plugins?

自作多情 提交于 2019-11-30 17:07:43
问题 I am trying to call an outside Perl module in a Template Toolkit .tt file. The module I want to use is Util , and I want to call Util::prettify_date . I was able to include this module using Template Toolkit's plugin interface: I set up the load, new, and error function (as described here: http://template-toolkit.org/docs/modules/Template/Plugin.html), and include it using [% USE Util %] . This works fine, but I was wondering if there's a way to USE Perl modules in Template Toolkit without