Lightweight exporting of variables
This is an alternative to Exporter intended to provide a lightweight subset
of its functionality. It supports 'import()', '@EXPORT' and '@EXPORT_OK'
and not a whole lot else.
Unlike Exporter, it is not necessary to inherit from Exporter::Lite (ie. no
'@ISA = qw(Exporter::Lite)' mantra). Exporter::Lite simply exports its
import() function. This might be called a "mix-in".
Setting up a module to export its variables and functions is simple:
package My::Module;
use Exporter::Lite;
@EXPORT = qw($Foo bar);
now when you 'use My::Module', '$Foo' and 'bar()' will show up.
In order to make exporting optional, use @EXPORT_OK.
package My::Module;
use Exporter::Lite;
@EXPORT_OK = qw($Foo bar);
when My::Module is used, '$Foo' and 'bar()' will _not_ show up. You have to
ask for them. 'use My::Module qw($Foo bar)'.
- Developed at devel:languages:perl
- Sources inherited from project openSUSE:Factory
-
1
derived packages
- Download package
-
Checkout Package
osc -A https://api.opensuse.org checkout openSUSE:Backports:SLE-15-SP4:FactoryCandidates/perl-Exporter-Lite && cd $_
- Create Badge
Source Files
Filename | Size | Changed |
---|---|---|
Exporter-Lite-0.07.tar.gz | 0000006601 6.45 KB | |
cpanspec.yml | 0000000547 547 Bytes | |
perl-Exporter-Lite.changes | 0000001757 1.72 KB | |
perl-Exporter-Lite.spec | 0000003131 3.06 KB |
Revision 10 (latest revision is 12)
1
Comments 0