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

Don't try to put in a variable by fiddling with the template. TT has a method to do so. It's called the stash.
#!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();
This solution becomes quite obvious when one reads the docs.


holli, /regexed monk/

Replies are listed 'Best First'.
Re^2: Template::Toolkit, DBI and mysql % wildcards
by bfdi533 (Friar) on Mar 14, 2006 at 21:14 UTC

    Thank you very much for the assistance!!

    That was exactly what I was looking for. I had read the manuals but there are so many parts of them that I did not know where to start to find the answer to my question.

      See here for a PDF version of the docs. There you got all the docs in 3 single documents (tutorial, manual, reference).


      holli, /regexed monk/