1N/A# On one line so MakeMaker will see it. 1N/AExporter::Heavy - Exporter guts 1N/ANo user-serviceable parts inside. 1N/A# We go to a lot of trouble not to 'require Carp' at file scope, 1N/A# because Carp requires Exporter, and something has to give. 1N/A my $
ok = \@{
"${pkg}::EXPORT_OK"};
1N/A # First make import warnings look like they're coming from the "use". 1N/A Carp::
croak(
"$_[0]Illegal null symbol in \@${1}::EXPORT")
1N/A # negated first item implies starting with default set: 1N/A warn "Import ".($
remove ?
"del":
"add").
": @names " 1N/A # If the version number was the only thing specified 1N/A # then we should act as if nothing was specified: 1N/A # We need a way to emulate 'use Foo ()' but still 1N/A # allow an easy version check: "use Foo 1.23, ''"; 1N/A # Last chance - see if they've updated EXPORT_OK since we 1N/A # accumulate the non-exports 1N/A Carp::
croak(
"@{carp}Can't continue after import errors");
1N/A # Build cache of symbols. Optimise the lookup by adding 1N/A # barewords twice... both with and without a leading &. 1N/A # (Technique could be applied to $export_cache at cost of memory) 1N/A "on this architecture");
1N/A Carp::
croak(
"Can't continue after import errors");
1N/A warn "Importing into $callpkg from $pkg: ",
1N/A # shortcut for the common case of no type character 1N/A (*{
"${callpkg}::$sym"} = \&{
"${pkg}::$sym"},
next)
1N/A *{
"${callpkg}::$sym"} =
1N/A $
type eq '&' ? \&{
"${pkg}::$sym"} :
1N/A $
type eq '$' ? \${
"${pkg}::$sym"} :
1N/A $
type eq '@' ? \@{
"${pkg}::$sym"} :
1N/A $
type eq '%' ? \%{
"${pkg}::$sym"} :
1N/A do {
require Carp;
Carp::
croak(
"Can't export symbol: $type$sym") };
1N/A (
undef) =
shift;
# XXX redundant arg 1N/A push(@{
"${pkg}::$var"},
1N/A # This may change to a die one day