my @array=(1..10); for my $i (@array){$i++;} print \"array is now:@array\";
this is changing the values of the array. Why?
I believe it is because in perl when you loop through an array, each element is passed by reference, meaning when you change $i in the loop, it is changing the actual value in the array. I'm not sure how to make it pass by value, though.