if ({nthcharacter of $string} eq "x") #### my @b = split(//, $string) ; if ($b[n] eq "x") {...}