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

Re: ||= operator

Thread Previous | Thread Next
From:
Noah Garrett Wallach
Date:
August 15, 2009 01:25
Subject:
Re: ||= operator
Message ID:
4A85DEDF.4020201@enabled.com
John W. Krahn wrote:
> Admin wrote:
>> Hi there,
> 
> Hello,
> 
>> is there a page that explains the ||= operator and similar operators?
>> google is not quite finding the special characters in the first 10 hits.
> 
> $left ||= $right
> 
> is just short for:
> 
> $left = $left || $right
> 
> and || is the logical OR operator.  So if $left is TRUE then it retains 
> the same value however if $left is FALSE it is assigned the value of 
> $right.
> 
> 
> John


thanks John.  that is what my tests showed but I could not find it in 
the docs. :)


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