On Mon, Oct 29, 2001 at 11:19:55AM +0100, [EMAIL PROTECTED] wrote:
> I would like to use arrays or hashes with the values I now store in
> this different variables. But when I use an array or a hash with the
> DEFAULT-directive, the values are only set, when the array or hash itself
> is not defined yet, but I would need to have alle the individual array- or
> hash-elements set, that are not defined.
You can use DEFAULT to set individual elements in an array or hash.
Something like this:
[% cols = [ 'red' 'green' ] %]
[% DEFAULT
cols.0 = 'scarlet' # doesn't get set, cols.0 is defined
cols.2 = 'blue' # does get set, cols.2 is undefined
%]
[% cols.join %] # red green blue
HTH
A