I think you're out of luck. I don't think there's an easy way to do this.
Perl.com: Maintaining Regular Expressions contains a minor amount of discussion about this. One relevant statement:
Therefore, Regexp::DeferredExecution should only be used with "constant" regular expressions; there is currently no way to overload dynamic, "interpolated" regular expressions.
Of course, whenever I see "no way" in a context like that, I know it means "no easy way"... and, knowing you, you'll manage to figure it out somehow. So, let us know when you do! ;-)
-sauoq "My two cents aren't worth a dime.";
In reply to Re: overload::constant passes fragments, not whole strings under interpolation. Help?
by sauoq
in thread overload::constant passes fragments, not whole strings under interpolation. Help?
by diotalevi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |