Moose
view release on metacpan or search on metacpan
lib/Moose/Exporter.pm view on Meta::CPAN
my $class = $exporting_package;
$CALLER = _get_caller(@_);
# this works because both pragmas set $^H (see perldoc
# perlvar) which affects the current compilation -
# i.e. the file who use'd us - which is why we don't need
# to do anything special to make it affect that file
# rather than this one (which is already compiled)
strict->import;
warnings->import;
my $did_init_meta;
for my $c ( grep { $_->can('init_meta') } $class, @{$exports_from} ) {
# init_meta can apply a role, which when loaded uses
# Moose::Exporter, which in turn sets $CALLER, so we need
# to protect against that.
local $CALLER = $CALLER;
$c->init_meta(
lib/Moose/Exporter.pm view on Meta::CPAN
return unless %new_style_roles || %old_style_roles || %base_class_roles;
return sub {
shift;
my %opts = @_;
$meta_lookup->($opts{for_class});
};
}
sub import {
strict->import;
warnings->import;
}
1;
# ABSTRACT: make an import() and unimport() just like Moose.pm
__END__
=pod
( run in 0.770 second using v1.01-cache-2.11-cpan-299005ec8e3 )