in reply to Precompiling qr/.../o question
Good question.
I think what the responses suggest, is that when you use qr//, it *is* compiled.. What I don't see a clear answer to is if although it is asked for multiple times, does the regex compiler do it one time only before runtime.
I would imagine the answer is no, if your loop happens at runtime (not in a package setup event).
Personally I tend to declare things like that outside the loop, since this will not change per iteration. Depending on what you're doing, this makes little difference. How many iterations are we considering? A thousand? A billion? WHy not just be safe and declare your qr// elsewhere???
|
|---|