Re: Overlapping RFCs 135 138 164

[email protected] (Steve Fink)
Newsgroups perl.perl6.language.regex
Organization Digital Integrity
Message-ID <[email protected]>
Tom Christiansen wrote:
> 
> >($foo = $bar) =~ s/x/y/; will never make much sense to me.
> 
> What about these, which are much the same thing in that they all
> use the lvaluability of assignment:
> 
>     chomp($line = <STDIN>);
>     ($foo = $bar) += 10;
>     ($foo += 3) *= 2;
>     func($diddle_me = $protect_me);
>     $n = select($rout=$rin, $wout=$win, $eout=$ein, 2.5);

I wasn't referring to the lvaluability of assignment. Which does confuse
me, but only from the scoping of 'my' in something like (my $foo = $bar)
+= 10. Which is very different from while(my $foo=bar) {...}. As for
($foo += 3) *= 2, it makes a lot more sense for it to work than not.
Though I've sometimes wished that (if (foo) { $bar } else { print
"bleh"; $bluck }) += 10 would work the same way.

I was referring to the visual similarity of = and =~, when in fact they
have nothing to do with one another. The expression I picked is just a
frequently encountered idiom that puts the two in close proximity. Your
proposed ~ thing would make it much rarer, but I still think =~ looks
like something to do with assignment.
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.