#!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)
or die $template->error();
####
file error - parse error - input text line 12-25: unexpected token (%')
####
[% TAGS [- -] %]
[- USE DBI('dbi:mysql:logs','','') -]
[- FOREACH item = DBI.query('$query') -]
[- item.user -]
[- END -]