my @c = split'',$str; $c[3] = 'b' if $c[7] eq 'N'; $str=join'',@c;