In Perl, what's the meaning of operator ||=
in the following example ?
$sheet -> {MaxCol} ||= $sheet -> {MinCol};
: one that operates: such as. : one that operates a machine or device. : one that operates a business. : one that performs surgical operations.
In quantum mechanics, for systems where the total number of particles may not be preserved, the number operator is the observable that counts the number of particles. The number operator acts on Fock space. Let.
In programming, an operator is a symbol that operates on a value or a variable. Operators are symbols that perform operations on variables and values. For example, + is an operator used for addition, while - is an operator used for subtraction.
The full form of OPR is Operator/Operate/Operation.
Definition: A Business Operator is the primary force driving a team working towards fulfillment of a company vision. This may be a dedicated team of contractors, but usually includes a mixture of contractors and employees.
US, Slang. a clever, persuasive person who generally manages to achieve his or her ends.
Operator: An auxiliary that performs a grammatical operation. The first auxiliary in a verb phrase is an operator. In short, this is the auxiliary that “does the work” in the verb phrase! Examples: You have been smoking >>> have is the operator here.
: a corporation organizer, member, or stockholder.
a ||= b
is similar to a = a || b
, so:
$sheet->{MaxCol} ||= $sheet->{MinCol};
is similar to:
$sheet->{MaxCol} = $sheet->{MaxCol} || $sheet->{MinCol};
Per ikegami's comment, the difference is that a ||= b;
only evaluates a
once, and it evaluates a
before b
. This matters when a
is magical or isn't a scalar.
$sheet -> {MaxCol} ||= $sheet -> {MinCol};
have same effect as
if (!$sheet->{MaxCol}) { $sheet->{MaxCol} = $sheet->{MinCol}; }
or
$sheet->{MaxCol} = $sheet->{MinCol} unless $sheet->{MaxCol};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With