As you most likely have found out by now assigning a new value to an array element is not possible directly. This fact is hidden quite well in the docu:
The "set" function can not be used to change the value of an element/attribute of an array, hash or an object. In fact, the elements/attributes of arrays, hashes and objects can not be changed from within template code.
So best write yourself a custom template operator that does the job, it is really easy to do. First check the contribution section though, maybe there is already such an operator there.
Hi Claudia, thank you for your hint - Indeed - I have read that part of the documentation several times. And I didn't recognize those tiny little sentences. And kracker is right: It took me quite a time to get to this point. What I ACTUALLY wanted to do, I will realize now using a custom event.