in reply to Template::Toolkit, DBI and mysql % wildcards
This solution becomes quite obvious when one reads the docs.#!perl use Template::Plugin::DBI; $query = <<"EOQ"; select user from logs where user not like 'adm%' EOQ $tt = <<"EOT"; [% USE DBI('dbi:mysql:logs','','') %] [% FOREACH item = DBI.query(query) %] [% item.user %] [% END %] EOT my $template = Template->new; $template->process(\$tt, {query => $query}) or die $template->error();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Template::Toolkit, DBI and mysql % wildcards
by bfdi533 (Friar) on Mar 14, 2006 at 21:14 UTC | |
by holli (Abbot) on Mar 15, 2006 at 14:42 UTC |