[Templates] Problem with single element arrays

Jess Robinson castaway@desert-island.me.uk
Mon, 20 Aug 2007 13:54:02 +0100 (BST)



On Mon, 20 Aug 2007, Simon Wilcox wrote:

> David wrote:
>>
>>  [% product.images.first.filename %]
>
> Try [% product.images.list.first.filename %] to force the scalar into a list, 
> it's a noop on listrefs. See also Template::Manual::VMethods

And it's broken when your list contains objects/hashrefs and not plain 
scalars.

Jess