in reply to One Dimensional Array into Two
A "two dimensional array" is really a one dimensional array whose entries are ref:ARRAY, that is references to arrays.
So you want something along the lines of:
which is using the anonymous array composer to generate each entry for the "two dimensional array".push @sheets, [split /\s+/, $line] ;
BTW, I wasn't sure whether you meant split /(\s)+/, which I believe will capture the whitespace separators as items in the resulting list ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: One Dimensional Array into Two
by moritz (Cardinal) on Aug 21, 2008 at 22:40 UTC | |
|
Re^2: One Dimensional Array into Two
by JoeJaz (Monk) on Aug 22, 2008 at 17:06 UTC |