in reply to looping in 2d array

So $textarray[1, 2, 3, 4, ...] are the words, $textarray[2][1, 2, 3, ... 9] are the grammar codes for the third word. If the first code matches nn|nns|...npl then for each of the 9 grammar codes, if the first code matches at|ati, print the first 6 grammar codes. That's what it looks like you are trying to do. Perhaps you can explain what you want to do with one word, and then figure out how to do it with the whole array.

1 Peter 4:10

Replies are listed 'Best First'.
Re^2: looping in 2d array
by AnomalousMonk (Archbishop) on Nov 02, 2014 at 22:24 UTC
    So $textarray[1, 2, 3, 4, ...] are the words, $textarray[2][1, 2, 3, ... 9] are the grammar codes ...

    NB: The Perlish syntax for these slices is (something like)  @textarray[1, 2, 3, 4] and  @{ $textarray[2] }[1, 2, 3, 7 .. 9] respectively.