summaryrefslogtreecommitdiff
path: root/lib/Carp
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-11-26 12:38:20 +0000
committerNicholas Clark <nick@ccl4.org>2006-11-26 12:38:20 +0000
commit792941b2ff890591e57d24cadb288f2aa39dfb7b (patch)
tree50c7dc4bab75b50c57851dee403313d8b26003cc /lib/Carp
parent1dc5a1cd6365e08f4fc3eb112b57b3cba7f744d7 (diff)
downloadperl-792941b2ff890591e57d24cadb288f2aa39dfb7b.tar.gz
Stop mod_perl looping forever in &Carp::shortmess_jmp as it somehow
manages to forcibly re-load Carp.pm without re-loading Carp/Heavy.pm p4raw-id: //depot/perl@29382
Diffstat (limited to 'lib/Carp')
-rw-r--r--lib/Carp/Heavy.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Carp/Heavy.pm b/lib/Carp/Heavy.pm
index 4355584d20..d5711ce859 100644
--- a/lib/Carp/Heavy.pm
+++ b/lib/Carp/Heavy.pm
@@ -64,7 +64,12 @@ sub shortmess_real {
# aliasing the whole glob rather than just the CV slot avoids 'redefined'
# warnings, even in the presence of perl -W (as used by lib/warnings.t !)
+# However it has the potential to create infinite loops, if somehow Carp
+# is forcibly reloaded, but $INC{"Carp/Heavy.pm"} remains true.
+# Hence the extra hack of deleting the previous typeglob first.
+delete $Carp::{shortmess_jmp};
+delete $Carp::{longmess_jmp};
*longmess_jmp = *longmess_real;
*shortmess_jmp = *shortmess_real;