[Templates] Re: Array to hash with 1 result

Sergey Martynoff sergey@martynoff.info
Mon, 9 Jul 2007 21:15:01 +0400


> Due to perl not being strong typed a subroutine can return whatever  
> it wants (scalar,hash,array,reference).
> 
> TT tries to guess what was returned so that is in the correct 
> context  by doing the following:

Oh yes, this is a known bug-feature :)
Cees was right, while I was confused by your code sample (which returns
arrayref, not array):

> >> If the function returns
> >> return [ { name => 'test' } ];


-- 
Sergey Martynoff