1Template::Plugin::ScalaUrs(e3r)Contributed Perl DocumentTaetmipolnate::Plugin::Scalar(3)
2
3
4
6 Template::Plugin::Scalar - call object methods in scalar context
7
9 [% USE scalar %]
10
11 # TT2 calls object methods in array context by default
12 [% object.method %]
13
14 # force it to use scalar context
15 [% object.scalar.method %]
16
17 # also works with subroutine references
18 [% scalar.my_sub_ref %]
19
21 The Template Toolkit calls user-defined subroutines and object methods
22 using Perl's array context by default. This plugin module provides a
23 way for you to call subroutines and methods in scalar context.
24
26 Andy Wardley <abw@wardley.org> <http://wardley.org/>
27
29 Copyright (C) 2008 Andy Wardley. All Rights Reserved.
30
31 This module is free software; you can redistribute it and/or modify it
32 under the same terms as Perl itself.
33
35 Template::Plugin
36
37
38
39perl v5.28.1 2018-10-05 Template::Plugin::Scalar(3)