On Mon, Jun 2, 2008 at 11:13 AM, Richard Lee <[EMAIL PROTECTED]> wrote: snip >> To compile the regex. In the original program, the regexes use the o >> modifier to promise that $pattern won't change so the optimizer can >> compile the regexes once, but if you use qr// then you don't have to >> make that promise and you still only compile the regex once. snip > thanks Chas, I have cheat sheet on my monitor and I only had qr as regex, I > am making a note on the fact that it actually compile only once regex and > should not be used at all time to do regex build. snip
I think you misunderstood what I was trying to say. The o modifier makes a promise that the variables being substituted into the regex will not change, thus allowing the optimizer to compile it only once. The qr// operator does not have this limitation, but still compiles the regex. -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/