Subject: | TTerse Restriction |
Manipulation of a complex structure appears to be disallowed, or not
obvious to me how to do it.
This very simple template results in the error "Cannot modify ., which
is not a lexical variable"
[% hashVar = {junk => 1} %]
[% hashVar.newVal = 2 %]
This appears to be disallowed as well.
[% hashVar = {junk => 1} %]
[% hashVar.junk = 2 %]
I have a controller which feeds a single dataset to a number of
different views. One view outputs a summary of the data which requires
manipulation of values within the hash to accomplish.
The general purpose aggregator for this one view type does not know the
full structure of hashVar.
This does something interesting but not what I want.
[% hashVar = {junk => 1} %]
[% hashVar = {hashVar.kv(), newVal => 2} %]
[% hashVar | dump %]
Output:
{ '1' => undef, 'ARRAY(0x74b3448)' => 'otherValue' }
Any ideas on how to manipulate values within a hash? I actually want to
poke a couple of layers deep because I am building an array of hashes
for the summary information.