#!/usr/bin/perl # create names lookup table from first file my %names; while (<>) { (my $col1)= split / /, $_; $names{$col1} = 1; last if eof; } # scan second file while (<>) { print if /^(\S+).*/ && not $names{$1}; }