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

So, how does your if condition work currently, and what do you want it to do instead?

Please help us help you better and supply a short, self-contained example that reproduces the problem you encounter. That way, we can more easily see the situation you are in and guide you better to a solution.

In your case, please add fake input data that makes your problem happen and also describe what should happen instead. Also add enough scaffolding around the code you currently have to declare and initialize all variables.

Replies are listed 'Best First'.
Re^4: pattern matching from an array to an array of arrays
by Anonymous Monk on Oct 22, 2016 at 13:41 UTC


    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

      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?