X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FMethod%2FDestructor.pm;h=41940973ece1c80f2070d227ece73ef9c4ee9006;hb=refs%2Ftags%2F0.40_02;hp=28e260f713df0be5f8539088c316332a25ca2f9e;hpb=7746ba36780a891bd98d610a99e42ccae5e8cdb2;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Method/Destructor.pm b/lib/Mouse/Meta/Method/Destructor.pm index 28e260f..4194097 100644 --- a/lib/Mouse/Meta/Method/Destructor.pm +++ b/lib/Mouse/Meta/Method/Destructor.pm @@ -1,5 +1,5 @@ package Mouse::Meta::Method::Destructor; -use Mouse::Util; # enables strict and warnings +use Mouse::Util qw(get_code_ref); # enables strict and warnings sub _empty_DESTROY{ } @@ -12,8 +12,7 @@ sub _generate_destructor{ my $demolishall = ''; for my $class ($metaclass->linearized_isa) { - no strict 'refs'; - if (*{$class . '::DEMOLISH'}{CODE}) { + if (get_code_ref($class, 'DEMOLISH')) { $demolishall .= "${class}::DEMOLISH(\$self);\n"; } } @@ -47,3 +46,17 @@ sub _generate_destructor{ 1; __END__ + +=head1 NAME + +Mouse::Meta::Method::Destructor - A Mouse method generator for destructors + +=head1 VERSION + +This document describes Mouse version 0.40_02 + +=head1 SEE ALSO + +L + +=cut