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

Re: ||= operator

Thread Previous | Thread Next
Shawn H. Corey
August 10, 2009 12:12
Re: ||= operator
Message ID:
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'


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

Just my 0.00000002 million dollars worth,

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

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About