On Sep-09, [EMAIL PROTECTED] wrote: > On Wed, 8 Sep 2004, Chip Salzenberg wrote: > > > According to [EMAIL PROTECTED]: > > > So how many stores do we expect for > > > ($a = "xxx") =~ s/a/b/g > > > and which of the possible answers would be more useful? > > > > I think it depends on C<($a = "aaa") =~ s/a/b/g>. > > I would agree with you in general, but since we're generally after speed, > surely we want to allow for optimisations such as "don't store unless > something's changed"; this would also be compatible with the boolean context > value of s///.
I vote for leaving all of these sorts of cases undefined. Well, partially defined -- I'd rather we didn't allow ($a = "aaa") =~ s/a/b/g to turn $a into "gawrsh". At the very least, define the exact number of output and stores for "strict aka slow mode", but have an optional optimization flag that explicitly drops those guarantees. It would allow for more flexibility in implementations.