while ($string=~m{[BCPTZabdhknpquvx]}g){ $count+=($tbsz*0.5625); }