[Templates] MACRO to return reference

[prev] [thread] [next] [Date index for 2005/02/13]

From: hsim
Subject: [Templates] MACRO to return reference
Date: 11:11 on 13 Feb 2005
--=_wNp432LAFe2ARKvbwDi69xPKCmppcl
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Dear fellow list subscribers,

I have a macro definition like follows:
	[% MACRO o(num) GET num_lookup.$num %]

Now my data structure looks like this:
	num_lookup => {
		':001' => {
			name => '/here',
			empty => 1,
		},
	},
	e => [ ':000', ':001', ],

My problem is that
	[% IF o(e.last).empty %]

does NOT work; whereas
	[% IF num_lookup.${e.last}.empty %]

works just fine.

How do I get my macro to return the reference/object?

Thanks,
	Nei

--=_wNp432LAFe2ARKvbwDi69xPKCmppcl
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3-nr1 (Windows XP) - GPGrelay v0.955

iD8DBQBCDzX6Z3Bqvf3gWdARAiXsAKDN3XsiqawQZErKvEBPCmLRmuzl0wCgrbBo
GKDQ7IiyXIjbL482fqCwVPA=
=EL9L
-----END PGP SIGNATURE-----

--=_wNp432LAFe2ARKvbwDi69xPKCmppcl--


_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] MACRO to return reference
hsim 11:11 on 13 Feb 2005

Generated at 08:55 on 15 Mar 2005 by mariachi v0.52