in reply to Re: Template::Toolkit, DBI and mysql % wildcards
in thread Template::Toolkit, DBI and mysql % wildcards

Yes in this case. But I often use it the DBI plugin like
[% USE DBI('dbi:mysql:logs','','') %] [% SET dbh = dbi.prepare(query) %] [% FOREACH user = user_list %] [% FOREACH item = dbh.execute(user) %] [% item.user %] [% END %] [% END %]
code:
$template->process(\$tt, {query => $query, user_list => [foo, bar]) or + die $template->error(); [download]
That's quite handy. Also when you put all the database stuff inside the templates, you can easily switch between databases, without touching the perl code.


holli, /regexed monk/