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

[email protected] (Tom Christiansen)
Newsgroups perl.perl6.language.regex
Message-ID <5174.967751519@chthon>
>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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.