Package::Pkg - Handy package munging utilities
version 0.0011
First, import a new keyword: pkg
pkg
use Package::Pkg;
Subroutine installation:
pkg->install( sub { ... } => 'MyPackage::myfunction' ); # myfunction in MyPackage is now useable MyPackage->myfunction( ... );
Subroutine exporting:
package MyPackage; use Package::Pkg; sub this { ... } # Setup an exporter for MyPackage, exporting 'this' and 'that' pkg->export( that => sub { ... }, 'this' ); package main; use MyPackage; this( ... ); that( ... );
Package::Pkg is a collection of useful, miscellaneous package-munging utilities. Functionality is accessed via the imported pkg keyword, although you can also invoke functions directly from the package (Package::Pkg)
Package::Pkg
Install a subroutine, similar to Sub::Install (and actually using that module to do the dirty work)
Setup an importer in the calling package
Sub::Install
Sub::Exporter
Class::MOP
Robert Krimen <robertkrimen@gmail.com>
This software is copyright (c) 2010 by Robert Krimen.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Package::Pkg, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Package::Pkg
CPAN shell
perl -MCPAN -e shell install Package::Pkg
For more information on module installation, please visit the detailed CPAN module installation guide.