print "\n Enter the file name :>"; chomp( my $filename1 = ); open my $fh, '<', $filename1 or die "Cannot find the file $filename1: $!"; while (<$fh>) { push (@line, $_); $count++; } open my $w, '>', 'Result.txt' or die "Cannot open the file Result.txt: $!"; for ($i = 0; $i < $count; $i++) { @st = split ("\t", $line [$i]); if ($st[3] ne $st [11]) { print $w $line [$i]; } } close $w; close $fh;