From: gfx Date: Fri, 26 Feb 2010 05:33:08 +0000 (+0900) Subject: Tidy _generate_destructor X-Git-Tag: 0.50_04~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=70a922201a3b13a22b86ea918f53d3b964c377c7;p=gitmo%2FMouse.git Tidy _generate_destructor --- 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{