Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Iterate over multiple data

by remluvr (Sexton)
on Mar 08, 2012 at 18:12 UTC ( [id://958512]=note: print w/replies, xml ) Need Help??


in reply to Re: Iterate over multiple data
in thread Iterate over multiple data

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

Replies are listed 'Best First'.
Re^3: Iterate over multiple data
by JavaFan (Canon) on Mar 08, 2012 at 19:10 UTC
    Seems you want to use a hash, keyed on $u where you can keep track of the different values you need.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://958512]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-03-28 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found