summaryrefslogtreecommitdiff
path: root/lib/Fatal.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Fatal.pm')
-rw-r--r--lib/Fatal.pm12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Fatal.pm b/lib/Fatal.pm
index a1e5cffcf4..d1d95af884 100644
--- a/lib/Fatal.pm
+++ b/lib/Fatal.pm
@@ -111,11 +111,13 @@ EOS
$code .= write_invocation($core, $call, $name, @protos);
$code .= "}\n";
print $code if $Debug;
- $code = eval($code);
- die if $@;
- local($^W) = 0; # to avoid: Subroutine foo redefined ...
- no strict 'refs'; # to avoid: Can't use string (...) as a symbol ref ...
- *{$sub} = $code;
+ {
+ no strict 'refs'; # to avoid: Can't use string (...) as a symbol ref ...
+ $code = eval("package $pkg; use Carp; $code");
+ die if $@;
+ local($^W) = 0; # to avoid: Subroutine foo redefined ...
+ *{$sub} = $code;
+ }
}
1;