Yes, the loop variable always aliases to the individual scalars. This is true. But in the case presented, with a bare, single array in for/foreach's list, perl also turns the loop into an iteration over the array itself, rather than flattening the array and iterating over the list of scalars.
In reply to Re: Re^2: Strangness with arrays
by Elian
in thread Strangness with arrays
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |