bfdi533 has asked for the wisdom of the Perl Monks concerning the following question:
I have a query that I am trying to use with Template Tookit. Here is my code:
#!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();
I am getting the following error when trying to use this code:
file error - parse error - input text line 12-25: unexpected token (%' +)
I also tried this:
[% TAGS [- -] %] [- USE DBI('dbi:mysql:logs','','') -] [- FOREACH item = DBI.query('$query') -] [- item.user -] [- END -]
The error was the same.
Any ideas on how to fix this?
Update: Fixed the query to be the same as the one that gives the error; it was a transcription error.
|
|---|