Tricky. I don't think you can do it without the eval. Unless the /ee option does the trick as ikegami suggests.
s/.../.../ee is short for s/.../eval .../e, so that "unless" is not an exception.
Your suggestion of re-interpolation sounds nice but is probably very tricky to implement.
It's not possible since interpolation involved executing arbitrary code. Maybe a limited form of interpolation? That would be possible and useful.
In reply to Re^2: reinterpolation of regexp (and strings?)
by ikegami
in thread reinterpolation of regexp (and strings?)
by AlwaysLearning
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |