if($sequence[1] =~ m/^(.*)$reg(.*)$/i){ for(my $x = 0; $x < $numInsertionDeletes; $x++){ $aligned[$posCount][$x] = ????????; } }