diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-02-19 05:08:29 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-02-19 05:08:29 +0000 |
commit | 2ba6ecf407bef45da384c153231c33d524202d81 (patch) | |
tree | d7b5cac0ecb692368fd1da2e4593a2ee5291a66f /lib/Fatal.pm | |
parent | d8118cadc52d40e092e6844d95847fefa280a0db (diff) | |
download | perl-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.pm | 12 |
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; |