From: Dave Rolsky Date: Fri, 20 Feb 2009 17:11:43 +0000 (+0000) Subject: Even better, include the code that failed to compile in the error. X-Git-Tag: 0.77_01~16 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0caae1168cadec2adbb25e63058557b7b9857a61;p=gitmo%2FClass-MOP.git Even better, include the code that failed to compile in the error. --- diff --git a/lib/Class/MOP/Method/Generated.pm b/lib/Class/MOP/Method/Generated.pm index dcb2721..9392cb9 100644 --- a/lib/Class/MOP/Method/Generated.pm +++ b/lib/Class/MOP/Method/Generated.pm @@ -51,7 +51,7 @@ sub _eval_closure { my $__captures = $_[1]; local $@; - eval join( + my $code = join( "\n", ( map { @@ -67,7 +67,9 @@ sub _eval_closure { ), $_[2] ); - die $@ if $@; + eval $code; + + die "$@\n$code" if $@; } sub _add_line_directive {