On Thu, Feb 26, 2009 at 10:52, Terence Monteiro <[email protected]> wrote:
> I need help with creating a hash in TT which has keys with whitespace in
> between. Quoting doesn't seem to work:
>
> h = {
> "foo bar" => "foobar"
> };
>
> I tried single quotes too. I can create a list and use the .hash vmethod
> for the purpose, or do the following:
>
> h.item("foo bar") = "foobar"
>
> Is there some quoting/escaping I can do and modify the first snippet and
> get it to work?
Maybe I'm misunderstanding your question, but this seems to work for me:
$ tpage
[% h = { "foo bar" => "foobar" }; h.item("foo bar"); %]
^D
foobar
$ tpage
[% h = { "foo bar" => "foobar" }; i = "foo bar"; h.$i %]
^D
foobar
Is that not what you mean?
--
(darren)
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates