I've written a template that has a chunk that look like
<tr>
[% FOREACH thingy = column %]
<td>
<select>
[% FOREACH cell = DBI.query("SELECT $thingy
from customer") %]
[% values = cell.list('values') %]
[% sortval = values.unique %]
[% FOREACH value = sortval %]
<option $thingy = "$value">
$value </option>
[% END %]
[% END %]
</select>
</td>
[% END %]
</tr>
I know my naming conventions are horrible. column is a var passed over
from the cgi currently created with
my column = qw (name address phone email)
so it's a list of the columns we want from the table customer in the db
The db call seems to return a hash of name value pairs which is unpacked
to give a list of names (for example) and that is uniqued before being
stuffed into a dropdown.
It all works fine apart form the uniquing stage which does nothing it's
as though I've written
[% values = cell.list('values') %]
[% FOREACH value = values %]
<option $thingy = "$value"> $value </option>
[% END %]
So how do I work out what's going on?
M
--
GPG key here. http://www.gatrell.org/gpg.public.key
signature.asc
Description: Digital signature
_______________________________________________ templates mailing list [email protected] http://mail.template-toolkit.org/mailman/listinfo/templates
