While you're right that very few patterns work in a lookbehind, it's wrong to add \Q..\E based on the possibility that the variable might contain patterns that aren't allowed in lookbehinds. Whether \Q..\E should be used or not is strictly based on whether $pre contains a pattern or literal text. Your advice would break the pattern /a.b/, for example.
If you want to catch invalid patterns, you need eval BLOCK, not \Q..\E.
In reply to Re^3: Using lookaround with variables
by ikegami
in thread Using lookaround with variables
by mwunderlich
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |