From: Jesse Luehrs Date: Sun, 24 Apr 2011 15:38:35 +0000 (-0500) Subject: but with this, perl won't do anything at all X-Git-Tag: 2.0100~197 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1d30d796884fc2b7f2e63432c73408a94264a32c;p=gitmo%2FMoose.git but with this, perl won't do anything at all perl seems to silently convert exceptions thrown in destructors into warnings, in the category of "misc", so disabling misc warnings means that exceptions in the destructor will be completely silent. confess inside destructors seems to be completely silent regardless, which also seems broken, but nothing we can really do about that. don't really want to add tests for this, because it's really not clear what the intended behavior is here. --- diff --git a/lib/Moose/Meta/Method/Destructor.pm b/lib/Moose/Meta/Method/Destructor.pm index 182f15e..2ce956d 100644 --- a/lib/Moose/Meta/Method/Destructor.pm +++ b/lib/Moose/Meta/Method/Destructor.pm @@ -122,7 +122,6 @@ sub _generate_DEMOLISHALL { (map { $inv . '->' . $_->{class} . '::DEMOLISH($igd);' } @methods), '}', 'Try::Tiny::catch {', - 'no warnings \'misc\';', 'die $_;', '};', ); diff --git a/lib/Moose/Object.pm b/lib/Moose/Object.pm index e47ad9c..1143231 100644 --- a/lib/Moose/Object.pm +++ b/lib/Moose/Object.pm @@ -92,9 +92,6 @@ sub DESTROY { $self->DEMOLISHALL(Devel::GlobalDestruction::in_global_destruction); } Try::Tiny::catch { - # Without this, Perl will warn "\t(in cleanup)$@" because of some - # bizarre fucked-up logic deep in the internals. - no warnings 'misc'; die $_; };