summaryrefslogtreecommitdiff
path: root/lib/Carp.pm
diff options
context:
space:
mode:
authorAaron Crane <arc@cpan.org>2010-09-27 12:02:01 +0100
committerFather Chrysostomos <sprout@cpan.org>2010-09-27 06:22:51 -0700
commit7154346bc9cb62d058f942090edfc5fc4d1e956a (patch)
treeb54cbd01ec6e06d2068b3db99a8bf7c323c7b41c /lib/Carp.pm
parent984730495a07ed8cbe2958b05c20564fd24321e2 (diff)
downloadperl-7154346bc9cb62d058f942090edfc5fc4d1e956a.tar.gz
[perl #78082] Carp.pm: Avoid autovivification of CORE::GLOBAL::caller
And add a test to prevent this happening again.
Diffstat (limited to 'lib/Carp.pm')
-rw-r--r--lib/Carp.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Carp.pm b/lib/Carp.pm
index 0e9105a9b7..6aba4275f6 100644
--- a/lib/Carp.pm
+++ b/lib/Carp.pm
@@ -86,7 +86,8 @@ sub caller_info {
@DB::args = (); # Don't let anyone see the address of $i
local $@;
my $where = eval {
- my $gv = B::svref_2object(\&CORE::GLOBAL::caller)->GV;
+ my $func = defined &{"CORE::GLOBAL::caller"} ? \&{"CORE::GLOBAL::caller"} : return '';
+ my $gv = B::svref_2object($func)->GV;
my $package = $gv->STASH->NAME;
my $subname = $gv->NAME;
return unless defined $package && defined $subname;