Re: Conflict with the VMethods

Aaron Trevena <[email protected]> Fri, 1 Jun 2012 12:10:44 +0100
Newsgroups gmane.comp.lang.perl.modules.template-toolkit
Message-ID <CAJWQ4V0GbudVNjajTY4LY13iHxLQTbJU8ceuu7w_PJ0iLOgCLw@mail.gmail.com>
On 29 May 2012 22:57, Matthew Whiteside <[email protected]> wrote:
> Hello,
>
> I am using template toolkit in conjunction with DBIx::Class::ResultSets. I
> would like to callĀ  the ResultSet object method "first", but I am getting
> weird results, I think due to a conflict with the TT virtual method "first".
>
> Is there a way to differentiate between a virtual method and a object method
> in TT?

You shouldn't get TT List virtual methods on objects - either you have a list
and so get list virtual methods like first, or you have a
scalar/reference to an object and first will be provided by that
object,  along with scalar vmethods ( unless they clash).

You may want to take a close look at what context your resultsets are
in in the template, and decide if you need the TT list vmethods or the
resultset iterator objects methods.

A.

-- 
Aaron J Trevena, BSc Hons
http://www.aarontrevena.co.uk
LAMP System Integration, Development and Consulting