in reply to Re^5: Reading two files, cmp certain cols
in thread Reading two files, cmp certain cols

"fake" is definitely the wrong word. So I can only guess what you want to do from your code. You seem to check if $position1 is between $current_line2-8 and $current_line2+8. In that case you have a bug in your code, in the line if ($pos = $position1) { the '=' should have been a '=='. Furthermore the loop isn't necessary, you only need two comparisions instead:

# $from = $current_line[2]-8; # $to = $current_line[2]+8; # for ($from .. $to){ # push (@range, $_); # } # } # foreach my $pos (@range){ # if ($pos == $position1) { # substitute with if ($position1>=$current_line[2]-8 and $position1<=$current_line[2]+8) {