NAME

slimpack - build a fatpacked, minified standalone Perl script

SYNOPSIS

slimpack [options] script
slimpack [options] -e/-E 'code' [-m/-M module ...]
slimpack trace   [--to=FILE|--to-stderr] [--use=MODULE] script
slimpack packlists-for MODULE...
slimpack tree    [PACKLIST ...]
slimpack bundle  [options] script
slimpack minify  [options] script...     # minify only, no bundling
slimpack --minify script...              # same, as a flag

DESCRIPTION

By default (pack) slimpack drives the whole fatpack pipeline internally by calling App::FatPacker's methods: it traces the boot script, drops core modules with Module::CoreList, resolves their packlists, copies the module sources into a temporary fatlib, then minifies and inlines plugins and emits a single standalone #!/usr/bin/perl script.

Each pipeline step is also exposed as its own subcommand with the same arguments as fatpack, so the individual steps can be run by hand.

minify (or the --minify switch) runs only the minification pass: each file is read, PPI-minified, and printed to STDOUT (or written with -o). Nothing is traced or bundled. The standalone minify script installed alongside slimpack offers the same mode.

OPTIONS

-o, --output FILE

Write the bundled script to FILE (default a.out; use - for stdout). minify prints to STDOUT unless -o is given.

--lib DIR

Project .pm sources (default lib).

--fatlib DIR

Fatpacked module tree (default fatlib; pack uses a temporary one).

--no-minify

Bundle modules and boot program verbatim, skipping the PPI minification pass.

--no-rename

Minify but leave variable names untouched (perl process(..., rename = 0)>). The default minifies and renames my variables. Applies to bundling and to the minify mode.

--rewrite

Additionally shorten keywords and operators into equivalent forms (foreach -> for, m/.../ -> /.../ after =~/!~, trailing ; before }, $x += 1 -> $x++, $x = $x OP $y -> $x OP= $y, print($x) -> print $x). Opt-in and experimental; disabled by default.

--no-compress

Embed module sources and the boot program verbatim instead of deflate + base64 compression. By default the minified source of each bundled module -- and the boot program, unless it contains a __DATA__/__END__ section -- is compressed at install time (best level) with the core Compress::Raw::Zlib module and MIME::Base64, and decompressed lazily by the embedded loader (also core-only) exactly when a module is required (or just before the boot program is evald). A boot program with a data section cannot be string-eval'd, so it is kept verbatim and a warning is issued. Raw --no-compress bundles keep the sources and boot program visible and readable, at the cost of a larger file.

--no-inline-plugins

Keep Module::Pluggable as a runtime dependency instead of inlining plugins.

--bundle-lib-all

Include every .pm under --lib, even if not referenced. By default only statically-reachable lib modules are bundled; fatlib is always fully included.

-m MODULE

Use MODULE with no imports (like perl -m).

-M MODULE[=list]

Use MODULE, optional import list or version (like perl -M).

-e CODE

Code to bundle; may be repeated (like perl -e).

-E CODE

Same as -e, but enables all features (like perl -E).

AUTHOR

Nicolas Mendoza <mendoza@pvv.ntnu.no>

LICENSE

Artistic License 2.0.

SEE ALSO

App::FatPacker, fatpack, App::SlimPacker