On 2011-02-11 11:26, Alan Haggai Alavi wrote:

$variable_1 ||= $variable_2 is equivalent to
$variable_1 = $variable_1 || $variable_2.

Hmm, I don't buy that, I would say that $x ||= $y is equivalent to

  $x = $y unless $x;

alternatively:

  $x or $x = $y;

because the setting of $x only needs to happen if $x is false.

Realize that C<$variable_1 = $variable_1;> can only be optimized away if no magic is involved.

--
Ruud

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to