App-perlimports
view release on metacpan or search on metacpan
lib/App/perlimports/Document.pm view on Meta::CPAN
}
}
return \%sub_names;
}
sub _has_import_switches {
my $self = shift;
my $module_name = shift;
# If switches are being passed to import, we can't guess as what is correct
# here.
#
# Getopt::Long uses a leading colon rather than a dash. This overrides
# Exporter's defaults. You would normally assume that :config is an export
# tag, but instead it's something entirely different.
#
# use Getopt::Long qw(:config no_ignore_case bundling);
#
# We will leave this case as broken for the time being. I'm not sure how
# common that invocation is.
lib/App/perlimports/ExportInspector.pm view on Meta::CPAN
my $use_statement = sprintf( 'use %s qw(:all);', $self->_module_name );
my ( $exports, $fatal_error )
= $self->_exports_for_include( $pkg, $use_statement );
if ($fatal_error) {
return { fatal_error => $fatal_error };
}
return $self->_list_to_hash( $pkg, $exports );
# If this module uses something other than Exporter or Sub::Exporter, we
# probably returned an empty hash above. We could guess and say it's the
# default exports + possibly something else. It's probably less confusing
# to leave it up to the code which uses this object to decide how to handle
# it.
}
sub _build_import_flags {
my $self = shift;
my %modules = (
Carp => ['verbose'],
lib/App/perlimports/Include.pm view on Meta::CPAN
return exists $self->_document->never_exports->{ $self->module_name }
|| $self->_export_inspector->is_oo_class;
},
);
sub _build_export_inspector {
my $self = shift;
return $self->_document->inspector_for( $self->module_name );
}
# If we have implicit (but not explicit) exports, we will make a best guess at
# what gets exported by using the implicit list.
sub _build_explicit_exports {
my $self = shift;
return $self->_export_inspector->has_explicit_exports
? $self->_export_inspector->explicit_exports
: $self->_export_inspector->implicit_exports;
}
## no critic (Subroutines::ProhibitExcessComplexity)
sub _build_imports {
( run in 0.786 second using v1.01-cache-2.11-cpan-702932259ff )