|XP is just a number|
Re: HTML::Template Accessing Params and Reassigningby snoopy (Deacon)
|on Aug 18, 2009 at 00:13 UTC||Need Help??|
A concise working code example is always best!
My guess is that you are seeing something like:
HTML::Template's param method is returning a scalar reference, so by assigning the return value to an array, you end up with a single element array. That element being the array reference.
The \@array expression then adds another level of indirection. You end up with an array reference to your one element array; the element being an array reference.
You need to work with a returned array reference. Example follows:
Also be aware of a potential trap with the one argument usage of param method. In the above example, if foo is deleted from the template, this method will returned undef rather than the array. I tend to avoid using it for this reason.
Update: Added loop_context_vars => 1 to HTML::Template->new(...). Now getting exactly the same error message as the OP.