X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FMethod%2FDestructor.pm;h=96ada5f0c9960b2db086bbcb051528986974c120;hb=5af36247683101e3c457450489486d41f0bd7101;hp=a2941b35f3b9e363c0ef8321dd2b13c7cad8edd1;hpb=c6e5eee14b916e727dd973cb19f943eb32a2e28e;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Method/Destructor.pm b/lib/Mouse/Meta/Method/Destructor.pm index a2941b3..96ada5f 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(:meta); # enables strict and warnings sub _empty_DESTROY{ } @@ -12,9 +12,7 @@ sub _generate_destructor{ my $demolishall = ''; for my $class ($metaclass->linearized_isa) { - no strict 'refs'; - no warnings 'once'; - if (*{$class . '::DEMOLISH'}{CODE}) { + if (Mouse::Util::get_code_ref($class, 'DEMOLISH')) { $demolishall .= "${class}::DEMOLISH(\$self);\n"; } } @@ -51,11 +49,11 @@ __END__ =head1 NAME -Mouse::Meta::Method::Accessor - A Mouse method generator for destructors +Mouse::Meta::Method::Destructor - A Mouse method generator for destructors =head1 VERSION -This document describes Mouse version 0.38 +This document describes Mouse version 0.49 =head1 SEE ALSO