descriptionA module to bundle modules inside a script
ownerflavio@polettix.it
last changeWed, 7 Sep 2011 05:50:49 +0000
Push URLssh://repo.or.cz/srv/git/mobundle.git
Content tags:
Add:
readme
mobundle - bundle modules inside your scripts

NAME

mobundle - bundle modules inside your scripts


VERSION

Ask the version number to the script itself, calling:

   shell$ mobundle --version


USAGE

   mobundle [--usage] [--help] [--man] [--version]
   mobundle [--autoscan|--scan|-a] [--body|-b <body>]
            [--body-from|--script|--program|-B <filename>]
            [--head|-h <head>] [--head-from|-H <filename>]
            [--head-from-body|-S <n>] [--head-from-paragraph|-P]
            [--module|-m <name>] [--modules-from|-M <filename>]
            [--output|-o <filename>] [--standard-head|-s]


EXAMPLES

   shell$ mobundle -m Template::Perlish -B yourscript.pl
   shell$ mobundle -m Template::Perlish --head '#!/path/to/perl' -B yourscript.pl
   shell$ mobundle -m Acme::Laugh --head-from-paragraph -B laugh.pl


DESCRIPTION

mobundle lets you bundle Perl modules inside your Perl script, in order to ship a single script instead of N separate files.

The underlying logic is simple: all modules are included in the generated script, and the module loading mechanism is tweaked in order to let you load the bundled modules. See the documentation for perlfunc/require to understand how.

The generated script will be compound of three main parts: a head, a section with the bundled modules and the logic to load them, and a body. Briefly speaking:

head

this is where you should put your shabang and the uses that you would like to happen before the module loading mechanism is tweaked.

The head is guaranteed to start at the very first octet in the result, so you can put a shabang.

modules

this part is generated automatically based on your instructions about which modules should be bundled.

body

this is the body of your script, i.e. what your script is supposed to do. It will likely contain either uses or requires that need the modules that are bundled in the modules section.

Why Another? Use PAR!

PAR is fantastic: lets you bundle all the needed components of your application inside a single executable, and ship it. But... there's a niche that it's not able to cover, at least looking at the documentation.

In particular, there seem to be two different operation modes, depending on your needs

My need was somewhere in between: on the one side I wasn't willing to bundle the interpreter, on the other I couldn't ensure that PAR was available.

In particular, this kind of need arises every time that my programs only need Pure-Perl modules, that do not need any platform-specific installation process. In this case, bundling the interpreter means restricting the applicability to one (or more, at some cost) platform only; the other way is simply not acceptable in some environments.


AUTHOR

Flavio Poletti flavio@polettix.it


LICENCE AND COPYRIGHT

Copyright (c) 2008, Flavio Poletti flavio@polettix.it. All rights reserved.

This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic and perlgpl.

Questo script รจ software libero: potete ridistribuirlo e/o modificarlo negli stessi termini di Perl stesso. Vedete anche perlartistic e perlgpl.


DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

shortlog
2011-09-07 Flavio PolettiMerge branch 'linode' master
2011-09-07 Flavio Polettimerged version in linode with local one linode
2011-09-07 Flavio Polettiadded -I|--include and inclusion markers
2009-11-24 Flavio PolettiCorrected a bug in the examples
2009-11-24 Flavio PolettiInitial import
heads
5 months ago master
5 months ago linode