[Templates] Missing hash and MACRO assignment in docs?

Paul Makepeace tt2.org@paulm.com
Mon, 18 Nov 2002 21:20:18 +0000


1.

The syntax,

[% farm = { pig => 2, sheep => 5 } %]

..I couldn't find anywhere in the docs. In Template::Manual::Variables
it mentions building lists but not hashes. Is this syntax supported?

2.

I discovered you can assign from MACRO foo BLOCK calls (which is great!)
but didn't see any mention of this feature in the section in
::Directives on MACROs. In the BLOCKs section with the "julius = BLOCK"
example it shows this but it strikes me this could be a bit more "out in
the open" with some examples using conditionals, e.g.

[% MACRO twice(a) BLOCK %]
 [% IF a > 3 %]
  [% a+a %]
 [% ELSE %]
  too small!
 [% END %]
[% END %]

[% a = twice(2) %]

**

If I haven't missed where these are documented I'm happy to make a
couple of .pod patches.

Cheers,
Paul

-- 
Paul Makepeace ....................................... http://paulm.com/

"What is the time in Boston? Terribly short and smelly."
   -- http://paulm.com/toys/surrealism/