You're compiling and executing the return value of m/$b/i. Did you mean eval "m/$b/i"?
eval "m/$b/i" is no good either. It doesn't solve the problem. In fact, it worsens it by adding three new characters ($, @ and /) to the list of characters that will cause problems.
In reply to Re^3: Regular expression match trouble with "+"
by ikegami
in thread Regular expression match trouble with "+"
by kwyjibo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |