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{ }
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";
}
}