Even though I don't understand what "for my $i (0 .. $#arr)"
$#array is the index of the last element of @array. Which is the same as the scalar(@array)-1;
a subroutine can change variables from the function it was called from
Yes, if you modify @_, it changes for the caller.
In reply to Re^3: Array value changing for some reason
by kschwab
in thread Array value changing for some reason
by Silt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |