use strict; my (%first, %second, %third); while () { my ($first, $second, $third, $fourth) = split ','; print unless exists $first{$first} and exists $second{$second} and exists $third{$third}; $first{$first}++; $second{$second}++; $third{$third}++; } __DATA__ A1, B1, C1, first record A2, B2, C2, second record A5, B2, C3, third record A4, B1, C3, fourth record A1, B3, C5, fifth record A2, B3, C5, sixth record A3, B1, C2, seventh record A4, B2, C4, eight record A1, B3, C4, nineth record A2, B1, C1, tenth record #### A1, B1, C1, first record A2, B2, C2, second record A5, B2, C3, third record A4, B1, C3, fourth record A1, B3, C5, fifth record A3, B1, C2, seventh record A4, B2, C4, eight record