my %lookup; # The hash that maps "in-house" to "different" and vice versa while (my $in_house_row = $csv->getline($fh)) { my $sample_name = $in_house_row->[0]; next if ! defined $lookup{$sample_name}; }