[% dateformat.x %]
looks in the dateformat
hash for a key of x
. To tell template toolkit that x
is a variable, prefix it with $
:
[% dateformat.$x %]
To access a hash entry using a key stored in another variable, prefix the key variable with '$' to have it interpolated before use (see Variable Interpolation).