You missed /^[ABC]\z/ which should be faster than an alternation (but is only viable with one letter options). I also wonder about length($str)==1 && $str=~/[ABC]/
In reply to Re^2: Collapsing repetitive equality tests: || vs {} vs // (an observation)
by demerphq
in thread Collapsing repetitive equality tests: || vs {} vs // (an observation)
by blogical
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |