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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Array value changing for some reason
by jwkrahn (Abbot) on Jan 01, 2019 at 02:23 UTC | |
Re^4: Array value changing for some reason
by Silt (Novice) on Jan 01, 2019 at 09:40 UTC | |
by poj (Abbot) on Jan 01, 2019 at 16:34 UTC |
In Section
Seekers of Perl Wisdom