Re: [Templates] Using Constants as Hash Keys

2012-11-29 Thread Dave Howorth
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

Re: [Templates] Using Constants as Hash Keys

2012-11-29 Thread Stuart Johnston
On 11/29/2012 4:24 AM, Dave Howorth wrote: 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

Re: [Templates] Using Constants as Hash Keys

2012-11-29 Thread Larry Leszczynski
Hi Stuart - It is a hashref. I just trimmed it down to the minimum that causes the error. To be more clear: [% x = { constants.foo = value } %] Or: [% function({ constants.foo = value }) %] Maybe want something like: [% foo = constants.foo; x = { $foo = value };

[Templates] Using Constants as Hash Keys

2012-11-27 Thread Stuart Johnston
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? ___ templates

Re: [Templates] Using Constants as Hash Keys

2012-11-27 Thread eric.berg
] Using Constants as Hash Keys 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

Re: [Templates] Using Constants as Hash Keys

2012-11-27 Thread Stuart Johnston
: Tuesday, November 27, 2012 12:50 PM To: templates@template-toolkit.org Subject: [Templates] Using Constants as Hash Keys 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