Olaf has asked for the wisdom of the Perl Monks concerning the following question:
It seems simple enough, but my attempts have crashed and burned. And I haven't found the answer just floating about in cyberspace. Is there a one line way to do this, or do I have to create it in a loop?my @RowOne = ("a","b","c"); my @RowTwo = ("d","e"); my @RowThree = ("f","g","h","i"); my @TwoDimArray = (\@RowOne,\@RowTwo,\@RowThree); my $ChosenRow = 1; # #Now I need one of the following: #The Chosen Array my @ChosenArray = ??? #or #The number of elements in the Chosen Array my $NumberOfElements = ???
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Extracting a row(1D array) from a multidimensional array
by Corion (Patriarch) on Oct 03, 2007 at 21:16 UTC | |
|
Re: Extracting a row(1D array) from a multidimensional array
by FunkyMonk (Bishop) on Oct 03, 2007 at 21:16 UTC | |
by Olaf (Acolyte) on Oct 04, 2007 at 13:50 UTC | |
|
Re: Extracting a row(1D array) from a multidimensional array
by throop (Chaplain) on Oct 04, 2007 at 03:22 UTC | |
|
Re: Extracting a row(1D array) from a multidimensional array
by graff (Chancellor) on Oct 04, 2007 at 00:56 UTC |