Skip to content

Commit

Permalink
Suppress "DEMOLISH used only once" warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jrubinator committed May 18, 2018
1 parent e6ae140 commit 885f2b3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Moose/Object.pm
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ sub DEMOLISHALL {

foreach my $class (@isa) {
no strict 'refs';
my $demolish = *{"${class}::DEMOLISH"}{CODE};
my $demolish = do {
no warnings 'once';
*{"${class}::DEMOLISH"}{CODE};
};
$self->$demolish($in_global_destruction)
if defined $demolish;
}
Expand Down

0 comments on commit 885f2b3

Please sign in to comment.