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

Re: ||= operator

Thread Previous | Thread Next
From:
Chas. Owens
Date:
August 10, 2009 11:50
Subject:
Re: ||= operator
Message ID:
58ce48dc0908101149g6c65a1b8ue01030bc7d5bf3e7@mail.gmail.com
On Mon, Aug 10, 2009 at 14:00, Shawn H. Corey<shawnhcorey@gmail.com> wrote:
> Chas. Owens wrote:
>>
>> =head2 C<X ||= Y>
>>
>> This is equivalent to C<X = X || Y>, see C<||> and C<=> for more
>> information.
>
> This is equivalent to C<X = X || (Y)>, see C<||> and C<=> for more
> information.
>
> =cut
>
> A subtle difference that can catch the unaware :)
snip

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.

-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

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