[Templates] Fundamental problem with the "." operator and hash keys

Mark Wagner Mark Wagner <markwag@u.washington.edu>
Wed, 12 Sep 2007 11:57:02 -0700


In perl one accesses a value in a hash reference like so:

$a->{'foo'}.

For the Template Toolkit that would be written like so:

a.foo

However this seems to place the restriction that keys must follow the
naming rules for variables (alphanumeric + _, leading char alpha).

I'm running into many situations where the key contains other characters
such as " " or "-". What is the best way to handle these? I hope it isn't:

bar = "key with spaces-n-dashes"
a.$bar

Thanks,

Mark

-- 
Mark Wagner <markwag@u.washington.edu>
System Administrator, UW Medicine IT Services
206-616-6119