in reply to Re: Empty List miracle(1)
in thread Empty List miracle(1)
I should have been clearer with my wording here. I wanted to say: the function is called in scalar context, and if it returns an array, the number of array elements should be printedthe function is called in scalar context, so that the number of list elements should be printed.That's not what scalar context does. Scalar context simply lets operators know they can only return a single scalar value. What that value is up to each individual operator.
I now understand from the replies that my mistake was to assume that lists and arrays behave the same in scalar context. Thanks to all of you for clarifying this.
|
|---|