in reply to Re^5: enumerating values for slopes
in thread enumerating values for slopes
You need to push on @AoA a reference to @vector:That way is buggy, though, as the redefinition of @vector will clobber the first pushed array element. This is explained under COMMON MISTAKES in perldsc, "taking a reference to the same memory location repeatedly".my @vector = (4.3125, 0.4375); push @AoA, \@vector; @vector = (4.375, 0.375); push @AoA, \@vector;
So both lines above should instead use a square bracket reference.
push @AoA, [ @vector ];
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: enumerating values for slopes
by Laurent_R (Canon) on Sep 24, 2014 at 06:59 UTC |
In Section
Seekers of Perl Wisdom