in reply to Iterate over multiple data

Can you explain what you want the output to be, and how the calculations go? And what are the different elements in this case?

Replies are listed 'Best First'.
Re^2: Iterate over multiple data
by remluvr (Sexton) on Mar 08, 2012 at 18:12 UTC

    My output (given that I compute AP for hyper) should be like the following:

    acacia-n hyper 1 ant-n hyper 1 apricot-n hyper 1

    Basically, for each different element of the first row of data I submitted as input, I should repeat the calculations my code does. The only problem I have is that I don't know how to make the code iterate only while acacia, and do the calculations on that data, then do them only for ant, and then do them only for apricot.
    I hope I made it a little clearer.
    Thanks again,
    Giulia

      Seems you want to use a hash, keyed on $u where you can keep track of the different values you need.