The problem is most likely in code you haven't shown us so we can only
guess. You might need to make a copy of the array:
my $vars = {
authors = [ @authorslog ];
}
dark0s wrote:
> The output is:
>
> $VAR1 = {
> 'authors' => [],
> };
>
> but if I try 'print @authorslog;' with cgi script, then it appears full!
>
> --- 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:32
>>
>>>> Try [% authors.size %] and it will likely show up
>> as zero.
>>> It outputs 0.
>>>
>>> I fill array in following way in .cgi script.
>>>
>>> my $vars = {
>>> authors = \...@authorslog;
>>> }
>> Missing semicolon at end of this line?
>>
>>
>>> $tt2->process('page.html', $vars) || die
>> $tt2->error();
>>> @authorslog is not empty.
>> Are you sure? Maybe try something like:
>>
>> my $vars = {
>> authors = \...@authorslog;
>> };
>>
>> use Data::Dumper;
>> die Dumper($vars) . "\n";
>>
>> $tt2->process('page.html', $vars) || die
>> $tt2->error();
>>
>>
>> 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
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates