From: Matt S Trout Date: Mon, 3 Oct 2011 05:38:31 +0000 (+0000) Subject: update DESTROY documentation X-Git-Tag: v0.009011~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FRole-Tiny.git;a=commitdiff_plain;h=debb3fcdbb4edbb3bc24154e07d94123785759eb update DESTROY documentation --- diff --git a/lib/Moo.pm b/lib/Moo.pm index 122aca9..175fd2c 100644 --- a/lib/Moo.pm +++ b/lib/Moo.pm @@ -223,9 +223,14 @@ instantiated. Typically this is used for object validation or possibly logging. =head2 DESTROY -A default destructor is provided, which calls +If you have a C method anywhere in your inheritance hierarchy, +a C method is created on first object construction which will call C<< $instance->DEMOLISH($in_global_destruction) >> for each C -method in the inheritance hierarchy. +method from child upwards to parents. + +Note that the C method is created on first construction of an object +of your class in order to not add overhead to classes without C +methods; this may prove slightly surprising if you try and define your own. =head2 does