[Templates] Assign and print at the same time

Brad Bowman list@bereft.net
Wed, 19 Sep 2007 10:56:52 +1000


> perl -e 'use Template; Template->new->process(
>   \"[% (a = 1 + 2) %] = [% a %]\n"
> )'
> 3 = 3
 >
> The parens are the trick.  

Thanks Paul, that's very handy.

Brad

-- 
  The essentials of speaking are not in speaking at all. If you think
  that you can finish something without speaking, finish it without
  saying a single word.        -- Hagakure http://bereft.net/hagakure/