develooper Front page | perl.beginners | Postings from August 2009

Re: ||= operator

Thread Previous | Thread Next
From:
Shawn H. Corey
Date:
August 10, 2009 12:12
Subject:
Re: ||= operator
Message ID:
4A8070F2.30408@gmail.com
Chas. Owens wrote:
> It is subtle enough that I don't see it, unless you meant X = (X) ||
> (Y) which solves the problem of operator precedence levels in X and Y,
> but I am assuming X and Y are already whole units.
> 

You're right.  I keep forgetting the lhs's can have side effects too.


But consider:

perl -le '$x=7;$x*=2+3;print $x'

vs.

perl -le '$x=7;$x=$x*2+3;print $x'


-- 
Just my 0.00000002 million dollars worth,
   Shawn

Programming is as much about organization and communication
as it is about coding.

I like Perl; it's the only language where you can bless your
thingy.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About