At 5:21 PM on 18 Aug 2010, dark0s wrote:
> It outputs 0.
>
> I fill array in following way in .cgi script.
>
> my $vars = {
> authors = \...@authorslog;
> }
That perl syntax is wrong. Use this:
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
--
C. Chad Wallace, B.Sc.
The Lodging Company
http://www.lodgingcompany.com/
OpenPGP Public Key ID: 0x262208A0
signature.asc
Description: PGP signature
_______________________________________________ templates mailing list [email protected] http://mail.template-toolkit.org/mailman/listinfo/templates
