use strict; use warnings; my %seen; while (<>) { if (/^DE|^GN/) { next if (/Putative uncharacterized protien/); foreach (/=([^;]+);/g) { my $lc = lc($_); if ( $seen{$lc}++ > 0) { print "hey! we already saw $lc!!\n"; } else { print "$lc\n"; } } } elsif (/^ID/) { print "\n"; } }