UNIVERSAL::exports(3pm)

UNIVERSAL::exports3pm

Lightweight, universal exporting of variables

Usage

  package Foo;
  use UNIVERSAL::exports;
  # Just like Exporter.
  @EXPORT       = qw($This &That);
  @EXPORT_OK    = qw(@Left %Right);
  # Meanwhile, in another piece of code!
  package Bar;
  use Foo;  # exports $This and &That.

Overview

This is an alternative to Exporter intended to provide a universal, lightweight subset of its functionality. It uses Exporter::Lite, so look there for details.

Additionally, exports() is provided to find out what symbols a module exports.

UNIVERSAL::exports places its methods in the UNIVERSAL namespace, so there is no need to subclass from it.

Methods

UNIVERSAL::exports has two public methods, import() derived from Exporter::Lite, and exports().

import
  Some::Module->import;
  Some::Module->import(@symbols);

This is Exporter::Lite's import() method. Look in Exporter::Lite for details.

exports
  @exported_symbols = Some::Module->exports;
  Some::Module->exports($symbol);

Reports what symbols are exported by Some::Module. With no arguments, it simply returns a list of all exportable symbols. Otherwise, it reports if it will export a given $symbol.

Diagnostics

'"%s" is not exported by the %s module'

Attempted to import a symbol which is not in @EXPORT or @EXPORT_OK.

'Can\'t export symbol: %s'

Attempted to import a symbol of an unknown type (ie. the leading $@% salad wasn't recognized).

BUGS and ISSUES

Please report bugs and issues via <http://rt.cpan.org>

Releases

11 releases since Debian 3.1 (Sarge); the text changed 6 times.

  1. 3.1
  2. 4.0–5.0
  3. 6.0–9
  4. 10
  5. 11
  6. 12
  7. 13

Authors

Michael G Schwern <[email protected]>

From libuniversal-exports-perl 0.05-5 in Debian 13 (Trixie). Parsed by carta from the page's man source.