use strict; die "Usage: $0 file.1 file.2\n" unless ( @ARGV == 2 ); # test for number of args my %known; open( F, "<", $ARGV[0] ) or die "$ARGV[0]: $!"; while () { chomp; $known{$_} = undef; # don't need a value, just the key } close F; open( F, "<", $ARGV[1] ) or die "$ARGV[1]: $!"; while () { my $key = ( split ' ', $_ )[0]; # get first "word" print unless exists( $known{$key} ); } close F; #### little_perl_script.pl file.1 file.2 > target.set