The ||= operator is a logical-OR assignment. It is like += , which is add-assign. It calculates the logical OR of LHS and RHS, and then assigns the result to LHS, so it must be a valid l value.
In other words, just like
$a += 3;
equivalently
$a = $a+3;
we can say that
$a ||= 1;
equivalently
$a = $a||1;
Now, regarding the statement that you mentioned in your question, there is a bit more going on there than in my example above. In your application, LHS is not just a simple variable token, but a variable token that is processed as a hash reference ( $sheet ) and dereferenced to get the value that is entered using the 'MaxRow' string. RHS is also a hash dereferencing operation on $sheet , but whose key is 'MinRow' . But the behavior is the same; we can say that
$sheet->{'MaxRow'} ||= $sheet->{'MinRow'};
equivalently
$sheet->{'MaxRow'} = $sheet->{'MaxRow'}||$sheet->{'MinRow'};
(Note. I always like to explicitly specify the values โโof the hash keys as strings, because this is what they are, but not everyone goes to this degree of clarity.)
For more information on the logical OR operation, see http://en.wikipedia.org/wiki/Logical_disjunction , and for Perl-specific information, see http://perldoc.perl.org/perlop.html#C-style- Logical-Or (for || and // ) and http://perldoc.perl.org/perlop.html#Logical-or-and-Exclusive-Or (for or ). The most relevant quote from the Perl documentation on || :
Binary "||" Performs a logical OR short circuit operation. That is, if the left operand is true, the right operand is not even evaluated. A scalar or list context extends to the right operand, if evaluated.
This does not quite explain this; in case the LHS evaluates a plausible value (see below for a definition), then the return value of the operation || is the LHS value, otherwise it is the RHS value.
In Perl, boolean values โโare usually represented by 0 (or sometimes '' or undef ) for false and 1 for true. However, more specifically, any value that is not one of the three false values โโlisted above is treated as true, and sometimes programmers refer to this difference using the unofficial terms of โtruthfulnessโ and โfalseโ. IOW, 0 , '' and undef are false, and everything else is true. See http://www.perlmonks.org/?node=what%20is%20true%20and%20false%20in%20Perl%3F for details.