In article <20030223004840.GA1442@ratsnest.hole>, Enache Adrian <enache@rdslink.ro> writes: > On Sat, Feb 22, 2003 at 09:11:03PM +0000, Ton Hospel wrote: >> This seems a case where the problem can be solved by simply dropping >> this optimization. If the value wasn't supposed to change all the >> time, the user would almost certainly have written s/$p// instead of >> s/(??{$p})//, so i think this optimization is not worth it (ok, someone >> might do it to set $^R and $^N) > > IMHO that optimization is worth keeping in. > (??{ ... }) 's may return (by different paths!) complicated regular > expressions or long chunks of text. > Caching them dramatically improves the performance. > I don't get it. - if the value isn't going to change (much), why did the user use a (??{$p}) ? What is the scenario in which you expect the cache to be hit ? - why is the r-magic not invalidated when the variable gets assigned ?Thread Previous | Thread Next