my %seen; while (my $line = <$IN>) { my $gn = $1 if $line =~ / GN=(\w+) /; next if exists $seen{$1}; $seen{$1} = 1; print $line; }