develooper Front page | perl.perl5.porters | Postings from January 2012

[perl #108778] no warnings "module name"

Thread Next
From:
Father Chrysostomos via RT
Date:
January 23, 2012 14:08
Subject:
[perl #108778] no warnings "module name"
Message ID:
rt-3.6.HEAD-13937-1327356484-648.108778-14-0@perl.org
On Sun Jan 22 12:52:17 2012, sprout wrote:
> perldiag lists some warnings in the ‘overload’ category.  What is not
>    documented anywhere is that this is a custom category registered by
>    overload.pm.
> 
> The result:
> 
> $ ./perl -Ilib -e 'use warnings; no warnings "overload"; ...'
> Unknown warnings category 'overload' at -e line 1
> BEGIN failed--compilation aborted at -e line 1.
> 
> If I load overload.pm first, it works fine.
> 
> While this could be argued as not being a bug, it just doesn’t feel
>    right.  It should be possible to disable a warnings category before
>    it is registered, because usually the code disabling the warnings
>    category doesn’t know when it is registered.

Also, ‘use warnings’ doesn’t enable overload warnings unless overload.pm
is already loaded.  So BEGIN { $^W = 1 } will actually give *more*
warnings than ‘use warnings; use overload ...’.  See also #108870.

-- 

Father Chrysostomos


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About