This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
428e011
)
fix context of caller call in Carp
author
Graham Knop
<haarg@haarg.org>
Mon, 23 Nov 2020 22:12:49 +0000
(23:12 +0100)
committer
Karl Williamson
<khw@cpan.org>
Mon, 23 Nov 2020 22:26:56 +0000
(15:26 -0700)
Carp's CARP_NOT variable is meant to have package names. caller in list
context returns the calling file and line in addition to the package
name.
Enforce scalar context on the call to caller to fix this.
dist/Carp/lib/Carp.pm
patch
|
blob
|
blame
|
history
diff --git
a/dist/Carp/lib/Carp.pm
b/dist/Carp/lib/Carp.pm
index
109b7fe
..
46aeaa5
100644
(file)
--- a/
dist/Carp/lib/Carp.pm
+++ b/
dist/Carp/lib/Carp.pm
@@
-284,7
+284,7
@@
sub shortmess {
my $cgc = _cgc();
# Icky backwards compatibility wrapper. :-(
- local @CARP_NOT =
$cgc ? $cgc->() : caller(
);
+ local @CARP_NOT =
scalar( $cgc ? $cgc->() : caller()
);
shortmess_heavy(@_);
}