if ( $sym ne $brd[$pos+1] or $sym ne $brd[pos+2] or $sym ne $brd[$pos+11] or $sym ne $brd[pos+22] ) { # symbol is legal in this position } else { # symbol is illegal in this position, try next symbol }