in reply to Re: Accessing constants via symbol table possible?
in thread Accessing constants via symbol table possible?

/o doesn't make the pattern compile at perl's compile time. It just means that when the expression is used and compiled it keeps the result instead of throwing away the compiled form. It doesn't imply that the regex itself is compiled at any particular time.


Seeking Green geeks in Minnesota

  • Comment on Re^2: Accessing constants via symbol table possible?

Replies are listed 'Best First'.
Re: Re^2: Accessing constants via symbol table possible?
by ihb (Deacon) on Feb 07, 2003 at 17:18 UTC
    I'm sorry, I was obviously smoking. I didn't mean that /o makes the pattern compile at program compile-time. The idea was to make perl do precompilation (at compile-time) by making it a match operator instead of an expression. (Perl precompiles constant patterns.) The /o was supposed to make sure that the pattern wasn't recompiled. But how I managed to perform this logic I don't understand myself. Because if I interpolate, precompilation can't occure anyway. And the /o is close to totally unnecessary, since the pattern will be the same and the optimization I mentioned myself about identical patterns will kick in. So the only thing saved is interpolation time.