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
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
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 };
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
] 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
: 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