Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Note that your assignment is using array slices @arr[0] and @arr[1]. Although it works, you should use $arr[0] and $arr[1] instead because they are not the same thing.
You could use the following method to initialize the 2-d array (use qw // and no commas, I hate to type commas :-)
Note that [ ... ] builds a reference to an array, it has 0 dimension. While ( ... ) builds an array, which has 1 dimension. When you assign an array to a zero dimension element @arr[0] or $arr[0], it only picks the first element from your array. And also you could use Data::Dumper to inspect your array afterwards.
In reply to Re: 2 dimensional array question
by Roger
|
|