my %seen; while (my $line = ) { @ID = split(/:/, $line); my $id = $ID[0]; if ($seen{lc($id)}++) { print "'$id' is duplicate\n"; } }