Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Now what I am trying to do is look through the names and then add up the corresponding number, and then print the output. Thus, in the above example my final output should look like:
I have set-up a third array which reads array 1 and just takes the unique names. Then I thought that a 4th array could be built by going through array3, looking for a match in array1, and adding the corresponding number. The final number being pushed into array4, so that at the end I just need to print array3 and array4.jim 1 steve 7 jim2 5 terry 2
But nothing I do seems to work, and now I have so many # lines in my program trying different things that I'm lost in the confustion.
Edit by tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: multiple arrays and lists
by DamnDirtyApe (Curate) on Jul 31, 2002 at 04:13 UTC | |
|
Re: multiple arrays and lists
by Bilbo (Pilgrim) on Jul 31, 2002 at 10:25 UTC |