From: Vincent Pit Date: Mon, 30 Mar 2015 19:39:04 +0000 (-0300) Subject: Always honor $ENV{PERL_DESTRUCT_LEVEL} when it's set for a debugging perl X-Git-Tag: v0.57~18 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=2d547b7955330e95e39d9eb532e8ab2522814f71;p=perl%2Fmodules%2FVariable-Magic.git Always honor $ENV{PERL_DESTRUCT_LEVEL} when it's set for a debugging perl I.e. don't fall back to Perl::Destruct::Level if the level is not high enough. --- diff --git a/t/lib/Variable/Magic/TestGlobalDestruction.pm b/t/lib/Variable/Magic/TestGlobalDestruction.pm index 06ab835..b616a8e 100644 --- a/t/lib/Variable/Magic/TestGlobalDestruction.pm +++ b/t/lib/Variable/Magic/TestGlobalDestruction.pm @@ -82,11 +82,8 @@ sub import { my $is_debugging = is_debugging_perl(); if ($is_debugging) { - my $ignoring = $env_level < $level ? ', ignoring' : ''; - _diag("Global destruction level $env_level set by PERL_DESTRUCT_LEVEL (debugging perl)$ignoring"); - unless ($ignoring) { - return 1; - } + _diag("Global destruction level $env_level set by PERL_DESTRUCT_LEVEL (debugging perl)"); + return ($env_level >= $level) ? 1 : 0; } else { _diag("PERL_DESTRUCT_LEVEL is set to $env_level, but this perl doesn't seem to have debugging enabled, ignoring"); }