Alan Burlison <[EMAIL PROTECTED]> writes:
>"Randal L. Schwartz" wrote:
>
>> Graham> sub def { my @a = (9,8,7); return @a; }
>>
>> That's not returning the array. That's returning a copy of the contents
>> of @a in a list context, and the number of elements of @a in a scalar
>> context, using the "@a" operator. You still haven't "returned the array".
>
>So then in fact it is impossible to return an array - yes? You can
>either return a single scalar or a list. The closest you can come to
>returning an array as an entity is to return a reference to it - \@a.
>
>Have I got that straight?
At the perl level yes. The core C can push an AV * on the stack
but perl does not know what it means. (Tk did this for a while
internally before I decided to comply with the perl semantics.)
--
Nick Ing-Simmons