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=b91ed2ae5e61d1bbb777833560b1b87d04a1b09b;hb=70a922201a3b13a22b86ea918f53d3b964c377c7;hpb=d990f7911dfd6a36d1dcc072e7adb72bf0379349 diff --git a/lib/Mouse/Meta/Method/Destructor.pm b/lib/Mouse/Meta/Method/Destructor.pm index b91ed2a..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{ @@ -54,7 +55,7 @@ Mouse::Meta::Method::Destructor - A Mouse method generator for destructors =head1 VERSION -This document describes Mouse version 0.50_02 +This document describes Mouse version 0.50_03 =head1 SEE ALSO