open(MASK, "/Users/logancurtis-whitchurch/Dropbox/thesis_folder/consensus_files/filtered_mask_files/filtered.mask."."$population".".txt") or die "can't open masked file\n"; my $mask = ; while (($n = read MASK, $data, 100000) != 0) { my @info = split(//, $data); foreach $info (@info){ if ($#info[$position] < $start) { #change the element at that position to an 'N' substr($mask,($position),1,'N'); $position++; } if (($#info[$position] >= $start) && ($#info[$position] <= $end) { $position++; } if ($#info[$position] > $end) { $count++;