FATPACK(1p)
π fatpack β the command line frontend for App::FatPacker π
okay bestie, listen. fatpack is literally the glow-up your Perl script has been waiting for. it's the command line frontend for App::FatPacker, and it's gonna take your script plus all its lil module dependencies and squish them into one single packed file. no cap. let's get into it π«Ά
β¨ COMMANDS β¨
π pack
$ fatpack pack myscript.pl > myscript.packed.pl
this is the one-shot slay β a shortcut that does all the work for you: tracing, collecting packlists, extracting modules in fatlib, and then concatenating everything into a packed script. one command, whole job done, periodt.
but if you need more detailed controls for additional modules, don't stress β just use the following commands separately (peep "RECIPES" below, iykyk).
π¦ trace
$ fatpack trace [--to=trace-file|--to-stderr] [--use=MODULE]
myscript.pl
this one compiles myscript.pl (literally like perl -c does) and writes out a trace file containing every module require()d during the compilation. the receipts, basically. π
- the trace file is called
fatpacker.traceby default β but the--tooption overrides that. - if you pass
--to-stderr, fatpack writes the trace toSTDERRinstead. - you cannot pass both
--toand--to-stderr. pick a lane, babe. π - if the
--useoption specifies a module (or modules, if used multiple times) those modules will be additionally included in the trace output. sneaky extra credit, love that for them.
πΈ packlists-for
$ fatpack packlists-for Module1 Module2 Module3
this cutie searches your perl's @INC for .packlist files containing the .pm files for the modules you requested, then emits a list of unique packlist files to STDOUT.
these packlists will, in a pure cpan-installation environment, be all non-core distributions required for those modules. so like, the full dependency roster.
π unfortunately most vendors strip the.packlistfiles, so if you installed modules via e.g.apt-getyou may be missing those modules. the preferred workaround is installing your dependencies into alocal::libfirst. do that, bestie, trust.
π tree
$ fatpack tree fatlib packlist1 packlist2 packlist3
takes a list of packlist files and copies their contents into a tree at the requested location. planting your little module garden. π±
this tree should be sufficient to use lib to make available all modules provided by the distributions whose packlists were specified. iconic behavior tbh.
π
$ fatpack file
wait the heading got eaten β it's the file command, obviously π
this one recurses into the lib and fatlib directories and bundles all .pm files found into a BEGIN block which adds a virtual @INC entry to load these files from the bundled code rather than disk. main character energy: it stops reading from disk and reads from itself.
π RECIPES π
current basic recipe for packing:
$ fatpack trace myscript.pl
$ fatpack packlists-for `cat fatpacker.trace` >packlists
$ fatpack tree `cat packlists`
$ fatpack file myscript.pl >myscript.packed.pl
four steps, one glow-up, absolute serve. β¨
π COPYRIGHT, LICENSE, AUTHOR π
see the corresponding sections in App::FatPacker. (not gatekeeping, just pointing you to the source fr fr π«Ά)
and that's the whole vibe check, bestie. this page came to you courtesy of perl v5.36.0, dated 2022-11-20 β go pack something iconic. mwah. πππ¦
π¦ where this page comes from
- debian bookworm: libapp-fatpacker-perl 0.010008-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libapp-fatpacker-perl 0.010008-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libapp-fatpacker-perl 0.010008-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libapp-fatpacker-perl 0.010008-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libapp-fatpacker-perl 0.010008-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms