in reply to Initializing multidimensional arrays
$matrix[$_][4]=undef for(0..4);
Which leads to the next logical question, why do we need to do this at all? The creation of the highest-index item in the array creates all lower-index undefs anyway, and if you try to get item and it's not there, the array's going to return an undef anyway.
So the quickest way to do it is not do it at all.
($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
=~y~b-v~a-z~s; print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Initializing multidimensional arrays
by cyocum (Curate) on Jun 01, 2005 at 12:37 UTC | |
by monarch (Priest) on Jun 01, 2005 at 13:25 UTC | |
by ihb (Deacon) on Jun 03, 2005 at 19:57 UTC | |
|
Re^2: Initializing multidimensional arrays
by Nkuvu (Priest) on Jun 01, 2005 at 16:06 UTC |