Let's say I want to interpolate a variable *inside* the name of a
hash key, for example --
I have a hash:
$hash = {
domain__foo.com => "value1",
domain__bar.com => "value2"
};
(assume that for some reason this was necessary
instead of just going with foo.com and bar.com
as keys)
and I want to access it in a template, where
a variable $d is set to "bar.com".
what I'd like to do is this:
[% hash.domain__${d} %]
but template toolkit balks at that. If I set a seperate
variable to "domain__${d}" and use that as the key, it
works fine. But I'd like to do this in a single statement
as it'll be repeated many times in my template. Is there
a way to do it?
thanks!
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates