Re: Using Constants as Hash Keys

Dave Howorth <dhoworth-fDajt2Yx3S8pY9vWkoisglpr/1R2p/[email protected]> Thu, 29 Nov 2012 10:24:34 +0000
Newsgroups gmane.comp.lang.perl.modules.template-toolkit
Organization MRC Laboratory for Molecular Biology
Message-ID <[email protected]>
Stuart Johnston wrote:
> Trying to use a constant as a hash key gives this error: "unexpected
> token (.)".
> 
> Here is what I am trying to do:
> 
> [% { constants.foo => "value" } %]
> 
> This works but is a bit ugly:
> 
> [% { ${constants.foo} => "value" } %]
> 
> Any other suggestions?

I don't understand what you are trying to do. What are the braces for?
What are you trying to achieve that isn't done by

  [% constants.foo => "value" %]