http://www.perlmonks.org?node_id=205407


in reply to comparing multiple lines in an array.

There's some good stuff about pulling out duplicate elements in an array here - you could probably adapt any of these solutions for your case, perhaps by using a hash of hashes of hashes.

§ George Sherston