I.e. don't fall back to Perl::Destruct::Level if the level is not high
enough.
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");
}