diff -rup Debuggit-2.05-3ZL4RV-orig/lib/Debuggit.pm Debuggit-2.05-3ZL4RV/lib/Debuggit.pm
--- Debuggit-2.05-3ZL4RV-orig/lib/Debuggit.pm 2014-11-17 22:09:06.000000000 -0800
+++ Debuggit-2.05-3ZL4RV/lib/Debuggit.pm 2014-11-17 22:09:14.000000000 -0800
@@ -154,7 +154,11 @@ sub import
my $debug_value = defined $opts{DEBUG} ? $opts{DEBUG} : defined $master_debug ? $master_debug : 0;
unless (defined $master_debug)
{
- *Debuggit::DEBUG = sub () { $debug_value };
+ # Perl does not know whether the string eval below will modify
+ # $debug_value, so it assumes the worst. So make the constant out
+ # of a new lexical scalar outside the eval's visible scope.
+ my $dbv2 = $debug_value;
+ *Debuggit::DEBUG = sub () { $dbv2 };
$master_debug = $debug_value;
}
@@ -170,7 +174,8 @@ sub import
{
# Thanx to tye from perlmonks for this line of code, which solves the Pod::Coverage issue
# (see t/pod_coverage.t).
http://www.perlmonks.org/?node_id=951831
- *{ join('::', $caller_package, 'DEBUG') } = sub () { $debug_value };
+ my $dbv2 = $debug_value; # See comment above about $dbv2.
+ *{ join('::', $caller_package, 'DEBUG') } = sub () { $dbv2 };
}
if ($debug_value)