Skip Menu |

This queue is for tickets about the Module-Runtime CPAN distribution.

Report information
The Basics
Id: 96943
Status: open
Priority: 0/
Queue: Module-Runtime

People
Owner: Nobody in particular
Requestors: ether [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: Lack of 'use strict; use warnings' causes important warnings to be swallowed
In Moo and Moose we were debugging some interesting issues with global destruction via DESTROY subs, and we discovered that these errors were being swallowed completely on newer perls because Module::Runtime does not 'use warnings'. Please, please please add 'use strict; use warnings;' to Module::Runtime!
On 2014-07-04 11:53:59, ETHER wrote: Show quoted text
> In Moo and Moose we were debugging some interesting issues with global > destruction via DESTROY subs, and we discovered that these errors were > being swallowed completely on newer perls because Module::Runtime does > not 'use warnings'. > > Please, please please add 'use strict; use warnings;' to > Module::Runtime!
Ideally, I think, Module::Runtime should (for the duration of a load operation) adopt the warnings levels and categories of its caller. This will allow a module to do warnings::warnif($category, $message) and the caller of require_module(..) to selectively disable these warnings as needed. This is particularly important for the 'deprecated' category. However, anything at all would be better than no warnings, because important failures in modules being loaded are being missed.
On 2016-10-24 18:04:37, ETHER wrote: Show quoted text
> On 2014-07-04 11:53:59, ETHER wrote:
> > In Moo and Moose we were debugging some interesting issues with > > global > > destruction via DESTROY subs, and we discovered that these errors > > were > > being swallowed completely on newer perls because Module::Runtime > > does > > not 'use warnings'. > > > > Please, please please add 'use strict; use warnings;' to > > Module::Runtime!
> > > Ideally, I think, Module::Runtime should (for the duration of a load > operation) adopt the warnings levels and categories of its caller. > This will allow a module to do warnings::warnif($category, $message) > and the caller of require_module(..) to selectively disable these > warnings as needed. This is particularly important for the > 'deprecated' category. > > However, anything at all would be better than no warnings, because > important failures in modules being loaded are being missed.
It should be quite safe to "use strict; use warnings;" in Module::Runtime. To fix the warning category issue, this is sufficient: $Carp::Internal{'Module::Runtime'} = 1;
Subject: Re: [rt.cpan.org #96943] Lack of 'use strict; use warnings' causes important warnings to be swallowed
Date: Wed, 24 May 2017 04:50:02 +0100
To: Karen Etheridge via RT <bug-Module-Runtime [...] rt.cpan.org>
From: Zefram <zefram [...] fysh.org>
Karen Etheridge via RT wrote: Show quoted text
>we discovered that these errors were being swallowed completely on >newer perls because Module::Runtime does not 'use warnings'.
That's weird. The state of lexical warnings in M:R shouldn't be affecting anything else. Can you give a specific example of code where a warning is lost because of this? Show quoted text
>Please, please please add 'use strict; use warnings;' to Module::Runtime!
"use strict" in M:R should be even less relevant to other code. Again, can you give an example where this would be required? I removed the use of these pragmata from M:R deliberately in order to avoid potential dependency problems. I'd need a compelling reason to bring them back. -zefram