Re: $& and copying: rfc 158 (was Re: RFC 110 (v3) counting matches)

2000-09-11 Thread Mark-Jason Dominus
> > in any case, i think we have a fair agreement on rfc 158 and i will > > freeze it if there is no further comments on it. > > I think you should remove the parts of your propsal about making $& be > autolocalized. If you're not planning to revise your RFC, let me know so that I can

Re: $& and copying: rfc 158 (was Re: RFC 110 (v3) counting matches)

2000-08-31 Thread Mark-Jason Dominus
> in any case, i think we have a fair agreement on rfc 158 and i will > freeze it if there is no further comments on it. In light of this: $& The string matched by the last successful pattern match (not counting any matches hidden within a BLOCK or eval() enclosed by the

Re: $& and copying: rfc 158 (was Re: RFC 110 (v3) counting matches)

2000-08-31 Thread Tom Christiansen
>actually it is more like which code refers to $& and which regex that >caem from. the problem stems from $& being a global and not local like >$1. Say what? They scope the same! sub foo { /./ } $_ = "stuff"; /.../; foo(); print $&; --tom

Re: $& and copying: rfc 158 (was Re: RFC 110 (v3) counting matches)

2000-08-31 Thread Mark-Jason Dominus
> MD> One of Uri's suggestions in RFC 158 was to compute $& only for > MD> regexes that have a /k modifier. This would solve the $& problem > MD> because Perl would compute $& only when asked to, and not for > MD> every other regex in the rest of the program. > > the rfc was about makin

$& and copying: rfc 158 (was Re: RFC 110 (v3) counting matches)

2000-08-31 Thread Uri Guttman
> "MD" == Mark-Jason Dominus <[EMAIL PROTECTED]> writes: MD> The $& cost is paid by every regex in the entire program, whether they MD> used it or not. This is because Perl has no way to tell which regexes MD> use $& and which do not. actually it is more like which code refers to $&