[Templates] Problem with single element arrays
Bill Ward
bill@wards.net
Mon, 20 Aug 2007 11:24:49 -0700
Why can't .first and .last on a scalar return that scalar?
On 8/20/07, Andy Wardley <abw@wardley.org> wrote:
> Jess Robinson wrote:
> > Kinda hard to do .size on something that isnt a list
>
> Unfortunately, it's not hard at all. scalar.size returns 1.
>
> Yeah, it's stupid I know. I kick myself every time I come up against the same
> problem (about twice a week).
>
> The .list .hash and .size vmethods are all being revamped for TT3 to do The
> More Right Thing. But I daren't change them in TT2 for fearing of breaking
> things and having a lot more people kicking me.
>
> Cheers
> A
>
>
> _______________________________________________
> templates mailing list
> templates@template-toolkit.org
> http://lists.template-toolkit.org/mailman/listinfo/templates
>