in reply to Re^2: Tricky scope problem
in thread Tricky scope problem
> perl -e '@arr = (1,2,3);$_++ foreach @arr;print @arr,"\n"' 234
By aliasing the loop variable, we gain the power to use foreach (and grep and map...) to create simple list operations without dealing with index syntax.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Tricky scope problem
by lostjimmy (Chaplain) on Apr 11, 2009 at 15:50 UTC |