in reply to Re^3: pattern matching from an array to an array of arrays
in thread pattern matching from an array to an array of arrays


Ok. So my starting data look like this:

1) this is how each array in @AoA is structured

[someword firstvalue secondvalue ...]

[otherword first value secondvalue ...]

[....]


2) @other_array

[someword

otherword

...]


I need to match the words ad align the firstvalue of each array in @AoA to each of the words in @other_array to obtain something like this:

@other_array

[someword firstvalueofthefirstarrayin@AoA firstvalueofthesecondarrayin@AoA ...

otherword firstvalueofthefirstarrayin@AoA firstvalueofthesecondarrayin@AoA ...]


I thought of rendering @other_array an array of arrays, but I thought that a more economic way to do that would be just to add the values to each string.


Thanks immensely for your patience

  • Comment on Re^4: pattern matching from an array to an array of arrays

Replies are listed 'Best First'.
Re^5: pattern matching from an array to an array of arrays
by AnomalousMonk (Archbishop) on Oct 22, 2016 at 15:17 UTC
Re^5: pattern matching from an array to an array of arrays
by Corion (Patriarch) on Oct 22, 2016 at 13:48 UTC

    Please try to convert the code you have posted above into a short, self-contained example that properly initializes @AoA and @other_array and then shows how this interacts with your code.

    Maybe, if you are just trying to find the words in @AoA that are in @other_array, a hash would make the lookup easier for you?