Assigning 2 here is equivalent to assigning a list with 2 as the only element.
That's not right. It's not equivalent to assigning to a list; it is assigning a list. That should read "You are assigning a list consisting of 2 as its only element." I believe you think that @a=2 and @a=(2) are different, but they aren't. Parens don't create lists.
In reply to Re^2: Perl assign scalar to array
by ikegami
in thread Perl assign scalar to array
by bagyi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |