Exporter::Easy 0.16
Exporter::Easy is a Perl module that takes the drudgery out of Exporting symbols. SYNOPSIS In module YourModule.pm: package
|
|||||||||||||||||||
Exporter::Easy is a Perl module that takes the drudgery out of Exporting symbols.
SYNOPSIS
In module YourModule.pm:
package YourModule;
use Exporter::Easy (
OK => [ '$munge', 'frobnicate' ] # symbols to export on request
);
In other files which wish to use YourModule:
use ModuleName qw(frobnicate); # import listed symbols
frobnicate ($left, $right) # calls YourModule::frobnicate
Exporter::Easy makes using Exporter easy. In it's simplest case it allows you to drop the boilerplate code that comes with using Exporter, so
require Exporter;
use base qw( Exporter );
use vars qw( @EXPORT );
@EXPORT = ( 'init' );
becomes
use Exporter::Easy ( EXPORT => [ 'init' ] );
and more complicated situations where you use tags to build lists and more tags become easy, like this
use Exporter::Easy (
EXPORT => [qw( init :base )],
TAGS => [
base => [qw( open close )],
read => [qw( read sysread readline )],
write => [qw( print write writeline )],
misc => [qw( select flush )],
all => [qw( :base :read :write :misc)],
no_misc => [qw( :all !:misc )],
],
OK => [qw( some other stuff )],
);
This will set @EXPORT, @EXPORT_OK, @EXPORT_FAIL and %EXPORT_TAGS in the current package, add Exporter to that package's @ISA and do a use vars on all the variables mentioned. The rest is handled as normal by Exporter.
Requirements:
tags
Download Exporter::Easy 0.16
Authors software
|
|
|
|
Similar software
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Other software in this category
|
|
|
|
|
|
|
|
|
|
Featured Software
jEdit 4.3 pre8
jEdit is an Open Source text editor written in Java
Opera 9.02
Surf the Internet in a safer, faster, and easier way with Opera browser
GNU Aspell 0.60.4
GNU Aspell is a Free and Open Source spell checker designed to eventually replace Ispell
- Communications
- Database
- Desktop Environment
- Games
- Internet
- Multimedia
- Office
- Programming
- Science and Engineering
- System
- Text Editing&Processing
