in reply to Template::Toolkit: better way to generate variable names?

from what i saw, the $var trick within TT only works for hash/ arrray keys, not for strings.

Did you try it? The examples in the docs for the SET directive would seem to imply that you're wrong :)

[% useName = "floorplan_name$s" %]
--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

Replies are listed 'Best First'.
Re: Re: Template::Toolkit: better way to generate variable names?
by geektron (Curate) on Aug 06, 2003 at 10:57 UTC
    i think that's the only combination i *didn't* try.

    the last one i tried was in the cgi.textfield method. something like:

    [% mycgi.textfield( '-name' => "floorplan_name${s}" ... ) %]
    and that gave me a template exception.