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

_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to