Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: ||= (poorly documented?)by frozenwithjoy (Priest) |
on Jul 09, 2012 at 05:55 UTC ( [id://980652]=note: print w/replies, xml ) | Need Help?? |
You are almost correct in understanding how it works. Whatever is on the right side of the ||= operator is used if the left side evaluates to undef, like you said; however, it is also used if the left evaluates to false.
I believe //, on the other hand, only tests for whether the left side is defined (but not for truthiness).
In Section
Seekers of Perl Wisdom
|
|