Here is the effect when perl localizes a variable:
#Whoops. An Anonymous Monk already posted a good example.And because a for loop aliases each element in the array to the loop variable, changes to the loop variable change the elements of the array.
In reply to Re^2: Dereference string in foreach
by 7stud
in thread Dereference string in foreach
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |