diff options
-rw-r--r-- | lib/Eval/Closure.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Eval/Closure.pm b/lib/Eval/Closure.pm index e45cb98..0037337 100644 --- a/lib/Eval/Closure.pm +++ b/lib/Eval/Closure.pm @@ -59,13 +59,14 @@ sub _clean_eval_closure { } my $code = eval _make_source(@_); + my $e = $@; if (!ref($code) || ref($code) ne 'CODE') { undef $code; - $@ = "The 'source' parameter must return a subroutine reference"; + $e = "The 'source' parameter must return a subroutine reference"; } - return ($code, $@); + return ($code, $e); } sub _make_source { |