in reply to Optionally / safely disabling a warning category for a complete package

Hi Corion,

It also seems to be possible that you add the following to Filter::signatures's import: warnings->unimport('experimental::signatures') if $] >= 5.020;

Test code:

bar.pl:

#!/usr/bin/env perl use warnings; use strict; use Foo; use feature 'signatures'; foo(9,10); sub foo($x,$y) { print $x+$y,"\n"; }

Foo.pm:

#!perl package Foo; use warnings; use strict; sub import { warnings->unimport('experimental::signatures') if $] >= 5.020; } 1;

Foo.pm with Exporter:

#!perl package Foo; use warnings; use strict; use parent 'Exporter'; sub import { warnings->unimport('experimental::signatures') if $] >= 5.020; __PACKAGE__->export_to_level(1, @_); } 1;

Hope this helps,
-- Hauke D