in reply to Re: Re: Re: Re: array or scalar, that's the question
in thread array or scalar, that's the question
You're right, I was being a bone-head. The '3' my examples returned wasn't the 3rd element, it was the fact that there were 3 elements in the array.
So yes, there is a very important distinction, but if anything, it's another case for not differentiating between a "scalar" and an "array" in the function, because with one element, a scalar context returns that one element, whereas multiple elements will get returned as an array, causing a scalar context to return the number of items in that array. This change in behavior is probably undesirable.
|
|---|