in reply to scalar in list context
A scalar is technically just a one element list.
There is no functional² difference between @list= (1) and @list=1 or between @list= (1,2,3,4);¹ and @list=(1,(2,3,(4)));
It's the comma operator which builds the list value (in list context).
Cheers Rolf
UPDATE: ¹)Parens corrected, THX chromatic! :)
Added second example.
²) Ikegami pointed out in a /msg that different grouping force different optrees, but of course the result is here the same...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: scalar in list context
by chromatic (Archbishop) on Jan 26, 2010 at 23:00 UTC | |
by LanX (Saint) on Jan 26, 2010 at 23:19 UTC |