Why don't you simply move the query out of the TT template?
my $dbh = DBI->connect( ... ); my $items = $dbh->selectall_arrayref(q{ select user from logs where user not like 'adm%' }, {Slice=>{}}); my $template = Template->new or die Template->error; $template->process(\*DATA, {items => $items}) or die $template->error; __DATA__ [% FOREACH item = items %] [% item.user %] [% END %]
UPDATE: I should have checked before posting, holli gave the same answer first. holli++
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re: Template::Toolkit, DBI and mysql % wildcards
by jeffa
in thread Template::Toolkit, DBI and mysql % wildcards
by bfdi533
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |