#!/usr/bin/perl use strict; use warnings; my (@genes, %tested); while (<>) { s/^>//; my ($col1, $col2) = split; push @genes, $col1; $tested{$col2}++; } { local $\ = "\n"; for (@genes) { print if not $tested{$_}; } }