in reply to Many-To-Many Relationship

You can start by referring to perlfaq4, specifically How do I compute the difference of two arrays? How do I compute the intersection of two arrays?. The code there is very good.

Short answer? Make a hash.