diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-07-21 13:56:53 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-07-21 13:56:53 +0100 |
commit | 067bb83c81c90d49b193f506de7fb39006f8b3c2 (patch) | |
tree | d34e8affd278f429871c094f46e6514a06f87fbc /lib/Carp.pm | |
parent | 5b235299a82969c391c126a8d9a1475362a595a6 (diff) | |
download | perl-067bb83c81c90d49b193f506de7fb39006f8b3c2.tar.gz |
In Carp, minimise the amount of code running in package DB.
Use a block to limit it to just the invocation of caller.
Diffstat (limited to 'lib/Carp.pm')
-rw-r--r-- | lib/Carp.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Carp.pm b/lib/Carp.pm index a08ff0fb19..add42d27fe 100644 --- a/lib/Carp.pm +++ b/lib/Carp.pm @@ -1,6 +1,6 @@ package Carp; -our $VERSION = '1.16'; +our $VERSION = '1.17'; our $MaxEvalLen = 0; our $Verbose = 0; @@ -66,11 +66,13 @@ sub cluck { warn longmess @_ } sub caller_info { my $i = shift(@_) + 1; - package DB; my %call_info; + { + package DB; @call_info{ qw(pack file line sub has_args wantarray evaltext is_require) } = defined &{"CORE::GLOBAL::caller"} ? &{"CORE::GLOBAL::caller"}($i) : caller($i); + } unless (defined $call_info{pack}) { return (); |