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:

push @sheets, [split /\s+/, $line] ;
which is using the anonymous array composer to generate each entry for the "two dimensional array".

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
    ... and if /(\s)+/ is really meant, it is cleaner written as /\s*(\s)/, in which case it's obvious that only the last matched whitespace will actually be in $1.
Re^2: One Dimensional Array into Two
by JoeJaz (Monk) on Aug 22, 2008 at 17:06 UTC
    I as having a seperate issue with the whitespace. Your suggestion to remove the parens solved in perfectly. Also, the syntax for the push is very concise. Thank you for your help. Joe