[Templates] Problem with single element arrays
Andy Wardley
abw@wardley.org
Mon, 20 Aug 2007 20:08:24 +0100
Bill Ward wrote:
> Why can't .first and .last on a scalar return that scalar?
They do. Or more generally, if you call any list vmethod on a scalar then it
will automagically upgrade it to a single element list before calling the vmethod.
The problem occurs when you've got a single item which is an object or a hash
array. Then it tries to call an object method/hash lookup before falling back
on a list vmethod.
In essence, the patch in 2.14a broke the fallback to a list vmethod, and
Jess's patch in 2.20 fixed it again.
Cheers
A