in reply to Removing partially duplicated lines from a file

If I understood the question, something like the below should work.
#!/bin/perl -w use strict; open TMP, "input.txt" || die ("could not open the input file \n"); my (%hash, @columns); for (<TMP>) { chomp; @columns = split ; next unless ($columns[1] && $columns[2]); if (not exists $hash{$columns[1].$columns[2]}) { $hash{$columns[1].$columns[2]}=1; print $_."\n" ; } } close TMP;