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

Re: ||= operator

Thread Previous | Thread Next
John W. Krahn
August 7, 2009 15:12
Re: ||= operator
Message ID:
Admin wrote:
> Hi there,


> 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.

Those people who think they know everything are a great
annoyance to those of us who do.        -- Isaac Asimov

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