in reply to Re^8: why doesn't "my ($a,$b)" return a list?
in thread why doesn't "my ($a,$b)" return a list?
Well, you started claiming an analogy between builtin functions and named operators. :)
"builtin function" is another name for "named operator". No analogy was made between the two.
I understand your point even less.
Already the fact that you can assign a list, i.e. my(LIST)=LIST is beyond the normal patterns of lvalue sub
How would changing my affect that statement?
I don't understand this point either.
An operator working on lists of variables having a special behavior in scalar context is IMHO strange!
No operator or builtin or sub can return more than value in scalar context. It simply makes no sense. The only reason you're in scalar context is because what will receive the value cannot handle more than one value.
map, sort, grep, reverse, and more all work on lists and behave specially in scalar context. What about keys, values, split, splice, m//g, s///g, and more whose primarily purpose is to return a list? They all return something else in scalar context.
I don't see what you find strange.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: why doesn't "my ($a,$b)" return a list?
by LanX (Saint) on Aug 19, 2010 at 21:30 UTC | |
by ikegami (Patriarch) on Aug 19, 2010 at 23:05 UTC | |
by LanX (Saint) on Aug 19, 2010 at 23:34 UTC | |
by ikegami (Patriarch) on Aug 19, 2010 at 23:37 UTC | |
by LanX (Saint) on Aug 20, 2010 at 21:33 UTC |