It outputs 0.

I fill array in following way in .cgi script.

my $vars = {
  authors = \...@authorslog;
}
$tt2->process('page.html', $vars) || die $tt2->error();

@authorslog is not empty.

--- Mer 18/8/10, Larry Leszczynski <[email protected]> ha scritto:

> Da: Larry Leszczynski <[email protected]>
> Oggetto: Re: [Templates] problem with array and FOEARCH
> A: "Template Toolkit" <[email protected]>
> Data: Mercoledì 18 agosto 2010, 19:08
> Hi -
> 
> > Adding [% USE dumper; dumper.dump(authors); -%], then
> it appears:
> > 
> > $VAR1=[];
> > Authors: ARRAY(0x9ff9278)
> > 
> > With:
> > 
> > [% FOREACH author IN authors %]
> > <tr><td>
> > [% author || "No author here" %]
> > </td></tr>
> > 
> > nothing appears.
> 
> Your "authors" array is empty.  That is why dumper
> reports it as "[]"
> and also why you never reach any message inside the
> loop.  Try [%
> authors.size %] and it will likely show up as zero.
> 
> Larry
> 
> _______________________________________________
> templates mailing list
> [email protected]
> http://mail.template-toolkit.org/mailman/listinfo/templates
> 


      

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to