Rafael Caceres wrote:
I'm trying to separate DBI stuff from the template -following the
comments on separating DBI from the template, but I'm having a problem
finding the correct way to pass variables used in the bind_columns() DBI
function.

You need to grab all the data and copy it into your own data structure which you pass to the template. Alternatively, you can make a plugin or object that can act as an iterator, the way Class::DBI does. That's more work.


#Now I attempt to have the binded columns available to the template. #I've tried 3 different ways, but none work: #method1: $$vars{"fields"}=[\$f_id,\$f_fapert,\$f_tipo,\$f_area,\$f_descrip];

You are creating a reference to a list of references to scalars. You should be just creating a reference to a list of scalars:
$vars->{"fields"} = [$f_id, $f_fapert, $f_tipo, $f_area, $f_descrip];


Of course this will not work for a select that returns multiple rows. For that, collect the data in an array of arrays (or array of hashes) and pass it to the template.

- Perrin


_______________________________________________ templates mailing list [EMAIL PROTECTED] http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to