in reply to Re: Initializing multidimensional arrays
in thread Initializing multidimensional arrays
Cody is right on this. Just declare the array and the treat it as if it were a 5x5 matrix because as long as you treat it like one, it will be one.
I guess you could do this:
Perl will fill in the array with undef's for you.use strict; use warnings; my @matrix; $matrix[4][4];
update: monarch is correct. It should be 4 because Perl defaults to an index of 0 for arrays unless you set the special variable $[ = 1.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Initializing multidimensional arrays
by monarch (Priest) on Jun 01, 2005 at 13:25 UTC | |
Re^3: Initializing multidimensional arrays
by ihb (Deacon) on Jun 03, 2005 at 19:57 UTC |
In Section
Seekers of Perl Wisdom