RogersMine
view release on metacpan or search on metacpan
local/lib/perl5/Moo.pm view on Meta::CPAN
my ($target, $name, $code) = @_;
$MAKERS{$target}{exports}{$name} = $code;
_install_coderef "${target}::${name}" => "Moo::${name}" => $code;
}
sub import {
my $target = caller;
my $class = shift;
_set_loaded(caller);
strict->import;
warnings->import;
if ($INC{'Role/Tiny.pm'} and Role::Tiny->is_role($target)) {
croak "Cannot import Moo into a role";
}
$MAKERS{$target} ||= {};
_install_tracked $target => extends => sub {
$class->_set_superclasses($target, @_);
$class->_maybe_reset_handlemoose($target);
return;
local/lib/perl5/Moo/_strictures.pm view on Meta::CPAN
use warnings;
sub import {
if ($ENV{MOO_FATAL_WARNINGS}) {
require strictures;
strictures->VERSION(2);
@_ = ('strictures');
goto &strictures::import;
}
else {
strict->import;
warnings->import;
warnings->unimport('once');
}
}
1;
local/lib/perl5/Role/Tiny.pm view on Meta::CPAN
&& bless([ $file ], 'Role::Tiny::__GUARD__');
local %^H if _WORK_AROUND_HINT_LEAKAGE;
require $file;
pop @$guard if _WORK_AROUND_BROKEN_MODULE_STATE;
return 1;
}
sub import {
my $target = caller;
my $me = shift;
strict->import;
warnings->import;
$me->_install_subs($target);
return if $me->is_role($target); # already exported into this package
$INFO{$target}{is_role} = 1;
# get symbol table reference
my $stash = _getstash($target);
# grab all *non-constant* (stash slot is not a scalarref) subs present
# in the symbol table and store their refaddrs (no need to forcibly
# inflate constant subs into real subs) with a map to the coderefs in
# case of copying or re-use
local/lib/perl5/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'};
local/lib/perl5/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.884 second using v1.01-cache-2.11-cpan-299005ec8e3 )