[Templates] differentiating hash entries / methods with same name

Dami Laurent (PJ) laurent.dami@justice.ge.ch
Tue, 7 Nov 2006 14:47:04 +0100


This is a multi-part message in MIME format.

------_=_NextPart_001_01C70273.951B5D70
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

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


------_=_NextPart_001_01C70273.951B5D70
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.5.7233.69">
<TITLE>differentiating hash entries / methods with same name</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=3D2 FACE=3D"Arial">Hi all,</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Suppose an object $obj has both a hash =
entry $obj-&gt;{foo} and a method $obj-&gt;foo().</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">If I pass this object to a =
template,&nbsp; [% obj.foo %] performs a method call.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;Is there a way to access the hash =
entry instead?</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Thanks in advance, L. Dami</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C70273.951B5D70--