Title: differentiating hash entries / methods with same name

If a blessed hash reference has a key foo and a method foo, TT will defer to the method call. This is in keeping with the design pattern of encapsulation. The rationale is that you may want to change the underlying implementation of the class, such that $obj->{foo} is moved to $obj->{foo}{main} to distinguish it from, say, $obj->{foo}{special}.

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dami Laurent (PJ)
Sent: Tuesday, November 07, 2006 8:47 AM
To: [email protected]
Subject: [Templates] differentiating hash entries / methods with same name

 

Hi all,

Suppose an object $obj has both a hash entry $obj->{foo} and a method $obj->foo().

If I pass this object to a template,  [% obj.foo %] performs a method call.

 Is there a way to access the hash entry instead?

Thanks in advance, L. Dami

Reply via email to