Defaults-Modern
view release on metacpan or search on metacpan
README.mkdn view on Meta::CPAN
- [strictures](https://metacpan.org/pod/strictures) (version 2), which enables [strict](https://metacpan.org/pod/strict) and makes most warnings
fatal; additionally [bareword::filehandles](https://metacpan.org/pod/bareword::filehandles) and [indirect](https://metacpan.org/pod/indirect) method calls are
disallowed explicitly (not just in development environments)
- The `v5.14` feature set (`state`, `say`, `unicode_strings`, `array_base`) -- except for
`switch`, which is deprecated in newer perls (and [Switch::Plain](https://metacpan.org/pod/Switch::Plain) is
provided anyway).
`experimental` warnings are also disabled on `v5.18+`.
- **carp**, **croak**, and **confess** error reporting tools from [Carp](https://metacpan.org/pod/Carp)
- **blessed**, **reftype**, and **weaken** utilities from [Scalar::Util](https://metacpan.org/pod/Scalar::Util)
- All of the [List::Objects::WithUtils](https://metacpan.org/pod/List::Objects::WithUtils) object constructors (**array**,
**array\_of**, **immarray**, **immarray\_of**, **hash**, **hash\_of**, **immhash**,
**immhash\_of**)
- **fun** and **method** keywords from [Function::Parameters](https://metacpan.org/pod/Function::Parameters) configured to
accept [Type::Tiny](https://metacpan.org/pod/Type::Tiny) types (amongst other reasonably sane defaults including
arity checks)
- The full [Types::Standard](https://metacpan.org/pod/Types::Standard) set and [List::Objects::Types](https://metacpan.org/pod/List::Objects::Types) -- useful in
combination with [Function::Parameters](https://metacpan.org/pod/Function::Parameters) (see the ["SYNOPSIS"](#synopsis) and
[Function::Parameters](https://metacpan.org/pod/Function::Parameters) POD)
- **try** and **catch** from [Try::Tiny](https://metacpan.org/pod/Try::Tiny)
lib/Defaults/Modern.pm view on Meta::CPAN
# Us
Defaults::Modern::Define->import::into($pkg);
# Core
Carp->import::into($pkg,
qw/carp croak confess/,
);
Scalar::Util->import::into($pkg,
qw/blessed reftype weaken/,
);
# Pragmas
strictures->import::into($pkg, version => 2);
bareword::filehandles->unimport;
indirect->unimport(':fatal');
warnings->unimport('once');
if ($] >= 5.018) {
warnings->unimport('experimental');
}
lib/Defaults/Modern.pm view on Meta::CPAN
provided anyway).
C<experimental> warnings are also disabled on C<v5.18+>.
=item *
B<carp>, B<croak>, and B<confess> error reporting tools from L<Carp>
=item *
B<blessed>, B<reftype>, and B<weaken> utilities from L<Scalar::Util>
=item *
All of the L<List::Objects::WithUtils> object constructors (B<array>,
B<array_of>, B<immarray>, B<immarray_of>, B<hash>, B<hash_of>, B<immhash>,
B<immhash_of>)
=item *
B<fun> and B<method> keywords from L<Function::Parameters> configured to
cmp_ok $qcstr, 'eq', '2+2 = 4', 'qc';
my @qcwlist = qcw/ foo {2+2} / ;
is_deeply \@qcwlist, ['foo', 4], 'qcw';
my $qcto = qc_to <<'EOT';
bar
#{2+2}
EOT
cmp_ok $qcto, 'eq', "bar\n4\n", 'qc_to';
# Scalar::Util
can_ok __PACKAGE__, qw/ blessed reftype weaken /;
# Try::Catch
can_ok __PACKAGE__, qw/ try catch /;
# match::simple
my @foo = qw/foo bar baz/;
ok 'foo' |M| \@foo, 'match::simple imported ok';
# true
use lib 't/inc';
( run in 0.892 second using v1.01-cache-2.11-cpan-65fba6d93b7 )