in reply to Extracting a row(1D array) from a multidimensional array
Works for me, as far as it goes.my @RowZero = ("a","b","c"); my @RowOne = ("d","e"); my @RowTwo = ("f","g","h","i"); my @TwoDimArray = (\@RowZero,\@RowOne,\@RowTwo); my $ChosenRow = 1; my @chosen_array = @{$TwoDimArray[$ChosenRow]}; my $num_chosen_items = @chosen_array; print "I chose row $ChosenRow (counting from 0),\n". " containing $num_chosen_items things: @chosen_array\n";
|
|---|