1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
=head1 NAME
PDL::Exporter - PDL export control
=head1 DESCRIPTION
Implements the standard conventions for
import of PDL modules in to the namespace
Hopefully will be extended to allow fine
control of which namespace is used.
=head1 SYNOPSIS
use PDL::Exporter;
use PDL::MyModule; # Import default function list ':Func'
use PDL::MyModule ''; # Import nothing (OO)
use PDL::MyModule '...'; # Same as Exporter
=cut
package PDL::Exporter;
use Exporter;
sub import {
my $pkg = shift;
return if $pkg eq 'PDL::Exporter'; # Module don't export thyself :)
my $callpkg = caller($Exporter::ExportLevel);
#print "DBG: pkg=$pkg callpkg = $callpkg\n";
push @_, ':Func' unless @_;
@_=() if scalar(@_)==1 and $_[0] eq '';
Exporter::export($pkg, $callpkg, @_);
}
1;
=head1 AUTHOR
Copyright (C) Karl Glazebrook (kgb@aaoepp.aao.gov.au).
All rights reserved. There is no warranty. You are allowed
to redistribute this software / documentation under certain
conditions. For details, see the file COPYING in the PDL
distribution. If this file is separated from the PDL distribution,
the copyright notice should be included in the file.
=cut
|