On 21.06.2008 10:48 Andy Wardley wrote: > There's a workaround for TT2 in the form of the scalar plugin. That's > new to 2.20 (which isn't released yet), but you can grab it from SVN. > > http://tt2.org/svnweb/Template2/view/trunk/lib/Template/Plugin/Scalar.pm > > [% USE Scalar %] > > # TT2 calls object methods in array context by default > [% object.method %] > > # force it to use scalar context > [% object.scalar.method %] > > # also works with subroutine references > [% scalar.my_sub_ref %]
Yes, this does indeed work, thanks! > The problem is fixed properly for TT3. All methods will be called in scalar > context by default. The '@' sigil will be used to force list context when > you really want it. > > # TT3 > [% object.method %] # scalar context by default > > [% [EMAIL PROTECTED] %] # force list context looking forward to it ;-) -Michael _______________________________________________ templates mailing list [email protected] http://mail.template-toolkit.org/mailman/listinfo/templates
