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