Dave Cross: Still Munging Data With Perl: Online event - Mar 27 Learn more

Recommended for 5.14
Remove huge B dependency from Carp, introduced with 5.14 to detect
incomplete caller override.
This reduces the memory and run-time footprint in case of errors,
and enables the compiler not to include B.
diff -u Carp.pm.orig Carp.pm
--- Carp.pm.orig 2011-12-31 18:13:12.000000000 -0600
+++ Carp.pm 2011-12-31 18:13:47.000000000 -0600
@@ -107,7 +107,12 @@
local $@;
my $where = eval {
my $func = $cgc or return '';
- my $gv = B::svref_2object($func)->GV;
+ my $gv =
+ *{
+ ( $::{"B::"} || return '') # B stash
+ ->{svref_2object} || return '' # entry in stash
+ }{CODE} # coderef in entry
+ ->($func)->GV;
my $package = $gv->STASH->NAME;
my $subname = $gv->NAME;
return unless defined $package && defined $subname;