in reply to Re: Re: Re: qr// with /e?
in thread qr// with /e?
*slaps forehead*
Yes, re-using the same variable works fine. Grr. Nothing like a bad case of the blindingly obvious, is there?
In the particular cases you bring up, using quotemeta might be a better option than mapping it to individual protected qr// objects. Not sure it matters all that much.
As for effeciency, I would hope that perl's regex engine would be smart enough to discard unnecessary non-capturing groups (which is the main side-effect of building up regexes with a bunch of smaller qr//s...)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: qr// with /e?
by hv (Prior) on Apr 24, 2004 at 09:32 UTC | |
by tkil (Monk) on Apr 26, 2004 at 04:40 UTC | |
by hv (Prior) on Apr 26, 2004 at 09:14 UTC |