Arthas-Defaults

 view release on metacpan or  search on metacpan

lib/Arthas/Defaults.pm  view on Meta::CPAN

package Arthas::Defaults;

use v5.14;
use warnings FATAL => 'all';
no warnings 'uninitialized';
use utf8;
use feature();
use version;
use Carp qw/carp croak confess cluck/;
use Try::Tiny;

our $VERSION = qv("v6.0");

require Exporter;
our @ISA       = ('Exporter');
our @EXPORT    = qw/
    carp croak confess cluck
    try catch finally
/;

sub import {
    feature->import(':5.14');
    strict->import();
    warnings->import(FATAL => 'all');
    warnings->unimport('uninitialized');
    utf8->import();

    # Export all @EXPORT
    Arthas::Defaults->export_to_level(1, @_);
}

sub unimport {
    feature->unimport();
    strict->unimport();
    warnings->unimport();
    utf8->unimport();
}

1;

__END__

=head1 NAME

Arthas::Defaults - Defaults for coding - Do not use if you're not Arthas. Also, this is only
for backward compatibility. Please use B<Arthas::Defaults::536>.

=head1 SYNOPSIS

    use Arthas::Defaults;

=head1 DESCRIPTION

It's like saying:

    use v5.14;
    use utf8;
    use warnings;
    no warnings 'uninitialized';
    use Carp qw/carp croak confess cluck/;
    use Try::Tiny;

Might change without notice, at any time. DO NOT USE!

=over

=item C<use v5.14>

This is actually C<use feature ':5.14'>. It imports some perl 5.10 -> 5.14
semantics, such as strict, Unicode strings, ... See
L<feature> documentation and source code for more information.

=item C<use utf8>

This is NOT related to handling UTF-8 strings or input/output (see
C<use feature 'unicode_strings'> imported with C<use v5.14> for
something more related to that).

C<use utf8> is imported in order to allow UTF-8 characters inside the source
code: while using UTF-8 in the source is not standard procedure, it
happens to me every now and then. Also, enabling this feature does
no harm if you're using a recent version of perl, so why not enable it?



( run in 1.523 second using v1.01-cache-2.11-cpan-e93a5daba3e )