Jon Allen > App-cpackage > cpackage


Annotate this POD

View/Report Bugs


cpackage - Create installation packages from CPAN modules


 cpackage My::CPAN::Module
 cpackage --mirror http://cpan.local --mirror-only My::Private::Module


cpackage builds installation packages from CPAN modules, containing all dependencies and an script. Running will install the module (and dependencies) without requiring Internet access or a configured CPAN client on the target machine.


To create an installer from a CPAN module, run the command:

 cpackage My::CPAN::Module

cpackage will use cpanm to download the module and its dependencies - these files will be placed in the packages/ directory. Your currently installed version of cpanm will be copied and bundled into the bin/ directory.

Finally an file will be written - running this script will install the module together with its dependencies.

All files will be written to the current working directory.

Using your own CPAN mirror

cpackage accepts the same command-line options as cpanm, so you can use it to build an installer from your own private CPAN or DarkPAN mirror.

 cpackage --mirror http://my.cpan --mirror-only My::Private::Module

If you have a DarkPAN mirror set up (e.g. using CPAN::Mini::Inject) you can create installers that contain a mix of private code and public CPAN code with full dependency resolution between the two.

Running the installer

To run the generated installer script, use the command:


Because the installer uses the bundled copy of cpanm, you can also give any of cpanm's standard options, e.g.

 perl --sudo




Jon Allen (JJ) <>


Copyright 2011 Jon Allen (JJ).

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See for more information.

syntax highlighting: