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=db966423c21ecad9b97542f03678c1c0e32cd1d8;hp=4b85dfcaea4f9ad90d3a6914db7d4946ee18d64a;hb=70a922201a3b13a22b86ea918f53d3b964c377c7;hpb=cb60d0b55962e6ff8cdc07e51e59f7dd5feafd43 diff --git a/lib/Mouse/Meta/Method/Destructor.pm b/lib/Mouse/Meta/Method/Destructor.pm index 4b85dfc..db96642 100644 --- a/lib/Mouse/Meta/Method/Destructor.pm +++ b/lib/Mouse/Meta/Method/Destructor.pm @@ -18,22 +18,23 @@ sub _generate_destructor{ } } - my $source = sprintf("#line %d %s\n", __LINE__, __FILE__) . <<"..."; + my $source = sprintf(<<'END_DESTROY', __LINE__, __FILE__, $demolishall); +#line %d %s sub { - my \$self = shift; - local \$?; - - my \$e = do{ - local \$@; + my $self = shift; + my $e = do{ + local $?; + local $@; eval{ - $demolishall; + # demolishall + %s; }; - \$@; + $@; }; no warnings 'misc'; - die \$e if \$e; # rethrow + die $e if $e; # rethrow } -... +END_DESTROY my $code; my $e = do{