Exporter-Tiny

an exporter with the features of Sub::Exporter
but only core dependencies

Exporter-Tiny is a Perl distribution including Exporter::Tiny and Exporter::Shiny.

An exporter is a module which implements an import method which allows other modules to import functions and variables into its namespace.

Exporters are essential for modular, functional programming in Perl.

GitHub Issues GitHub Actions Coveralls status Codecov status

Features for You

Generators

Generate a coderef on-the-fly to be installed into your caller's package.

Tags

Just like Exporter.pm!

Easy Config

Just use @EXPORT , @EXPORT_OK , and %EXPORT_TAGS .

Zero dependencies

Exporter::Tiny only uses core Perl modules.

Features for Your User

Lexical Imports

On newer versions of Perl (or if optional dependencies are installed), your caller can import your functions lexically.

Renaming

Your caller can choose a different name for imported functions.

A quick example

Using Exporter::Tiny directly

package MyUtils {
  use base "Exporter::Tiny";
  our @EXPORT_OK = qw( frobnicate );

  sub frobnicate {
    ...;
  }
}

use MyUtils 'frobnicate' => { -as => 'frob' };

print frob( 42 ), "\n";

Using the Exporter::Shiny shortcut

package MyUtils {
  use Exporter::Shiny qw( frobnicate );

  sub frobnicate {
    ...;
  }
}

use MyUtils 'frobnicate' => { -as => 'frob' };

print frob( 42 ), "\n";

Exporter-Tiny is available for most Linux and BSD distributions. See installation advice .

Arch Linux perl-exporter-tiny
Debian libexporter-tiny-perl
Fedora OS perl-Exporter-Tiny
Manjaro perl-exporter-tiny
Redhat perl-Exporter-Tiny
SuSE perl-Exporter-Tiny
Ubuntu libexporter-tiny-perl
FreeBSD p5-Exporter-Tiny

Powered by Perl

What is Perl?

Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions. In 1998, it was also referred to as the "duct tape that holds the Internet together."