develooper Front page | perl.perl5.porters | Postings from February 2003

Re: [perl #20683] [fix] /(??{$x})/ ignore any changes made to $x

Thread Previous | Thread Next
Enache Adrian
February 22, 2003 16:48
Re: [perl #20683] [fix] /(??{$x})/ ignore any changes made to $x
Message ID:
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.



Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About