>>> sub fn { return (3,5,7) }
>>> $x = fn; # I want $x==3
>Let me try once more. I want that fn() to act like
> sub fn { my @a = (3,5,7); return @a}
Oh. You want lists to act like arrays. That's a very big change.
>You are letting the scalar context of the caller to bleed through the return
>and effect the _syntatic_ meaning of the comma.
So what?
>TC> This is not a new concept, nor an isolated one. Here's another list:
>TC> $x = @ENV{HOME,USER,TERM};
>Not the same. I'm only interested in action-at-a-distance. Where there
>is a sub and a return in between. I have no objection to that.
return @ENV{HOME,USER,TERM};
had jolly well not be returning 3. I'm returning a LIST, dang it.
I don't ever expect a list to be an array. Try popping it, for
example.
>TC> Sure, there are functions that can do those things, but these
>TC> aren't functions who get to be quirky. This is completely
>TC> expected.
>To you perhaps. I feel that the syntactical change is unexpected.
>But do you any objectsions to making this limited change? When the
>EXPR of a return is a literal list, it should not have its comma
>changed?
Yes, I object.
The comma is NOT changed. It's doing exactly what a list does.
It never returned an array. You now want (1,2,3) to be an array!!
--tom