XP is just a number | |
PerlMonks |
Re^6: Variable assignment error checkingby hdb (Monsignor) |
on Dec 15, 2013 at 10:20 UTC ( [id://1067219]=note: print w/replies, xml ) | Need Help?? |
It is not! In this expression:
the return value of func($var) will be assigned to $var if func($var) is true, otherwise the value of $var. In this expression
the return value of func($var) will be assigned to $var if $var is false. Completely different logic! The expression $var ||= func( $var ); is shorthand for $var = $var || func( $var );. Can you spot the difference?
In Section
Seekers of Perl Wisdom
|
|