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
From:
Enache Adrian
Date:
February 22, 2003 16:48
Subject:
Re: [perl #20683] [fix] /(??{$x})/ ignore any changes made to $x
Message ID:
20030223004840.GA1442@ratsnest.hole
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.

Regards

Adi

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About