ikegami has given you a solution that works in your case, but in general, the steps to take to solve the "how do I remove redundant data" question are along these lines:
- Identify the information that determines if a set of data is unique. This is the key. It may need to be normalized (the sort @F[0,1] call in ikegami's response, for example).
- See if the key has already been used. Hashes are useful for this (the !$seen{...}++ construct in ikegami's response). See How can I remove duplicate elements from a list or array? (or perldoc -q duplicate) for more information.
- Process the duplicate data for that key. In some cases it you are only interested in the last data associated with the key, in others you may want to group all of the data together, in still others, you may want to run some function on all of the data associated with that key.
- Return the processed results.
If you step through your question using this framework, it can be easier to come up with a solution on your own.
Update: Added references to ikegami's response