in reply to Array got modified!
- Yes it is normal
- Yes, all versions.
If any element of LIST is an lvalue, you can modify it by modifying VAR inside the loop. Conversely, if any element of LIST is NOT an lvalue, any attempt to modify that element will fail. In other words, the foreach loop index variable is an implicit alias for each item in the list that you're looping over.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Array got modified!
by exilepanda (Friar) on Oct 10, 2011 at 02:54 UTC | |
by Jenda (Abbot) on Oct 10, 2011 at 10:25 UTC | |
by exilepanda (Friar) on Oct 10, 2011 at 12:51 UTC | |
by Anonymous Monk on Oct 10, 2011 at 13:00 UTC | |
by exilepanda (Friar) on Oct 10, 2011 at 13:19 UTC | |
| |
by choroba (Cardinal) on Oct 10, 2011 at 13:44 UTC | |
by exilepanda (Friar) on Oct 10, 2011 at 16:03 UTC | |
by BrowserUk (Patriarch) on Oct 10, 2011 at 03:36 UTC | |
by exilepanda (Friar) on Oct 10, 2011 at 03:54 UTC | |
by choroba (Cardinal) on Oct 10, 2011 at 07:31 UTC |
In Section
Seekers of Perl Wisdom