$A[ord $_]++ for split '', $str; if (grep $_, @A[map ord, a..z,A..Z]) { ... }