summaryrefslogtreecommitdiff
path: root/lib/Carp.pm
diff options
context:
space:
mode:
authorSteve Hay <SteveHay@planit.com>2005-05-03 08:51:24 +0000
committerSteve Hay <SteveHay@planit.com>2005-05-03 08:51:24 +0000
commit62e1ddac2ea58cd2a35011515be4801254772ba8 (patch)
treee3439b004419ecce35771e52cebf31e6eaf7affd /lib/Carp.pm
parentf350b448ae021c71a4662e0a5bb0b3454004be98 (diff)
downloadperl-62e1ddac2ea58cd2a35011515be4801254772ba8.tar.gz
Fix croak() and confess() so that they don't clobber $!
(plus tests to check this) p4raw-id: //depot/perl@24374
Diffstat (limited to 'lib/Carp.pm')
-rw-r--r--lib/Carp.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Carp.pm b/lib/Carp.pm
index b2e634ca5f..d2854c090e 100644
--- a/lib/Carp.pm
+++ b/lib/Carp.pm
@@ -226,8 +226,8 @@ sub export_fail {
sub longmess {
{
- local $@;
- # XXX fix require to not clear $@?
+ local($@, $!);
+ # XXX fix require to not clear $@ or $!?
# don't use require unless we need to (for Safe compartments)
require Carp::Heavy unless $INC{"Carp/Heavy.pm"};
}
@@ -251,8 +251,8 @@ sub longmess {
sub shortmess { # Short-circuit &longmess if called via multiple packages
{
- local $@;
- # XXX fix require to not clear $@?
+ local($@, $!);
+ # XXX fix require to not clear $@ or $!?
# don't use require unless we need to (for Safe compartments)
require Carp::Heavy unless $INC{"Carp/Heavy.pm"};
}