in reply to •Re: Re: Re: •Re: RegEx re-compilation
in thread RegEx re-compilation
Aha!
Many thanks - of course from the point of view of of a non-hacker this raises as many questions as it answers (well, 2:1 in this case ;)
Is perl just checking whether the value of the vars in the regex have changed, or the regex opcodes?
In either case (but particularily the latter), isn't there some overhead involved in checking whether recompilation is needed? Indeed, if an opcode comparison is taking place, won't that take just as long as recompiling (since it will presumably have to recompile the "new" expression in order to compare it with the old)?
I may be wildly off-beam here, but it seems a similiar situation to:
$foo = 'hello world' unless $foo eq 'hello world';
being a slightly pointless check, and better replaced with:
$foo = 'hello world';
Of course, I'm probably wrong about that as well.... which I could well be if assignment is more time consuming than comparison...
|
|---|