in reply to Re: logical-assignment operators
in thread logical-assignment operators

Here is yet another way to use ||=.
$cache{$a} ||= expensive_sub($a);

Here we have an expensive operation on $a, and we want to save the result so that if $a is seen again, we already have the answer from expensive_sub().