if ($input{$name}[2] == $pos) { my $fSNP = substr($seq, 0, 1); print OUT "$fSNP\n"; } if ($input{$name}[2] == $pos+35) { my $fSNP = substr($seq, 35,1); print OUT "$fSNP\n"; } if ($input{$name}[2] != $pos+35 && $input{$name}[2] != $pos) { my $SNP = substr($seq, 0, $input{$name}[2]-($pos-1)); my $fSNP = substr($SNP, $input{$name}[2]-$pos); print OUT "$fSNP\n"; }