Re: copying and s/// (was Re: Overlapping RFCs 135 138 164)

[email protected] (Tom Christiansen)
Newsgroups perl.perl6.language.regex
Message-ID <3368.967671126@chthon>
>  TC>     ($this = $that) =~ s/foo/bar/;
>  TC>     for (@these = @those) { s/foo/bar/ } 

>  TC> You can't really do those in one step without it.

>but do they really need to be combined into one step? i sometimes prefer
>the separate assignment statement for clarity. other times i feel i am
>in a compressing mood.

It's like why you can say

    while ( (ch = getc()) != EOF ) { ... } 

With assignment an expression, not a statement, you can use
a larger expression.  Python people hate this. :-)

--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.