X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FMethod%2FDestructor.pm;h=df3d4898ee206f7c422ae4eca1d80bb810dc6660;hp=61ab200db067a191159af5d8ecc3ef6a6a70911d;hb=6a97bbdad44391f2a587165cb81fcf8aedc642ac;hpb=b842ace0d446cc7e87c823e72fd74f68d495142b diff --git a/lib/Mouse/Meta/Method/Destructor.pm b/lib/Mouse/Meta/Method/Destructor.pm index 61ab200..df3d489 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,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 (get_code_ref($class, 'DEMOLISH')) { $demolishall .= "${class}::DEMOLISH(\$self);\n"; } } @@ -55,7 +53,7 @@ Mouse::Meta::Method::Destructor - A Mouse method generator for destructors =head1 VERSION -This document describes Mouse version 0.40 +This document describes Mouse version 0.40_04 =head1 SEE ALSO