strictures
view release on metacpan or search on metacpan
lib/strictures.pm view on Meta::CPAN
my $method = "_enable_$version";
if (!$class->can($method)) {
require Carp;
Carp::croak("Major version specified as $version - not supported!");
}
$class->$method($opts);
}
sub _enable_1 {
my ($class, $opts) = @_;
strict->import;
warnings->import(FATAL => 'all');
if (_want_extra($opts->{file})) {
_load_extras(qw(indirect multidimensional bareword::filehandles));
indirect->unimport(':fatal')
if $extra_load_states{indirect};
multidimensional->unimport
if $extra_load_states{multidimensional};
bareword::filehandles->unimport
if $extra_load_states{'bareword::filehandles'};
lib/strictures.pm view on Meta::CPAN
'experimental', # no reason for these to be fatal
'deprecated', # unfortunately can't make these fatal
'portable', # everything worked fine here, just may not elsewhere
);
our @V2_DISABLE = grep { exists $warnings::Offsets{$_} } (
'once' # triggers inconsistently, can't be fatalized
);
sub _enable_2 {
my ($class, $opts) = @_;
strict->import;
warnings->import;
warnings->import(FATAL => @WARNING_CATEGORIES);
warnings->unimport(FATAL => @V2_NONFATAL);
warnings->import(@V2_NONFATAL);
warnings->unimport(@V2_DISABLE);
if (_want_extra($opts->{file})) {
_load_extras(qw(indirect multidimensional bareword::filehandles));
indirect->unimport(':fatal')
if $extra_load_states{indirect};
( run in 0.439 second using v1.01-cache-2.11-cpan-299005ec8e3 )