[Html-widget] Template error with 1 element HW

Brian Kirkbride brian.kirkbride at deeperbydesign.com
Fri Sep 22 22:10:23 CEST 2006

Hello All,

I'm having a wierd error when rendering a very simple HTML::Widget in Template 
Toolkit.  If the form has only one element and I have a template like:

FOREACH element = form.elements;

Catalyst croaks with a template error:

Coldn't render template "undef error - Can't use string ("1") as an ARRAY ref 
while "strict refs" in use at 
line 117.

This only happens with one element forms and I used to get around it with:

elements = form.elements.size == 1 ? [ form.elements ] : form.elements;
FOREACH element = elements;

in the template, but that is not working on my production machine.

Has anyone else had this error?

Thanks in advance,
Brian Kirkbride

More information about the Html-widget mailing list