summaryrefslogtreecommitdiff
path: root/lib/Fatal.pm
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-02-19 05:08:29 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-02-19 05:08:29 +0000
commit2ba6ecf407bef45da384c153231c33d524202d81 (patch)
treed7b5cac0ecb692368fd1da2e4593a2ee5291a66f /lib/Fatal.pm
parentd8118cadc52d40e092e6844d95847fefa280a0db (diff)
downloadperl-2ba6ecf407bef45da384c153231c33d524202d81.tar.gz
bring '*' prototype closer to how it behaves internally
p4raw-id: //depot/perl@2978
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;