cut -f3 -d, file1.cut.sort cut -f3 -d, file2.cut.sort comm -23 file1.cut.sort file2.cut.sort #### use strict; use warnings; my $file2 = {}; open my $fh2, " ) { chomp; my @fld = split /\,/; $file2 -> { $fld[2] } = 1; } close $fh2; open my $fh1 " _ ) { chomp; my @fld = split /\,/; defined( $file2 -> { $fld[2] } ) and next; print "$_\n"; } close $fh1;