From: Dave Rolsky Date: Mon, 7 Feb 2011 23:18:23 +0000 (-0600) Subject: Clarify what happens when weak refs go out of scope X-Git-Tag: 1.9903~24 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7f6c317055603a29f396d9166a93c05a852991a3;p=gitmo%2FMoose.git Clarify what happens when weak refs go out of scope --- diff --git a/lib/Moose/Manual/Attributes.pod b/lib/Moose/Manual/Attributes.pod index f809fd0..ff5af8b 100644 --- a/lib/Moose/Manual/Attributes.pod +++ b/lib/Moose/Manual/Attributes.pod @@ -396,6 +396,15 @@ C whenever the attribute is set: This is very useful when you're building objects that may contain circular references. +When the object in a weak references goes out of scope, the attribute's value +will become C "behind the scenes". This is done by the Perl interpreter +directly, so Moose does not see this change. This means that triggers don't +fire, coercions aren't applied, etc. + +The attribute is not cleared, so a predicate method for that attribute will +still return true. Similarly, when the attribute is next accessed, a default +value will not be generated. + =head2 Triggers A C is a subroutine that is called whenever the attribute is