http://www.perlmonks.org?node_id=1227852


in reply to Re^2: Array value changing for some reason
in thread Array value changing for some reason

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.