PERLSTRIP(1)

πŸ“¦ version 1.2, in nixos 26.05, nixpkgs unstable

πŸŽ€ PERLSTRIP β€” bestie edition πŸŽ€

ok so like, this is perlstrip, and it lives in the User Contributed Perl Documentation section of your man pages (iykyk). it's a lil glow-up tool for your perl sources β€” we're making files smaller by yeeting comments, pod, whitespace... the whole "clutter era" basically. πŸ’…


✨ NAME ✨

perlstrip β€” make perl sources smaller by removing comments, pod, whitespace...

no cap, that's the whole personality. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

perlstrip file...
perlstrip --size --cache file...

-v                verbose
--size            optimise for size (also: -s)
--cache           use a cache (also: -c)
--cache-dir path  cache directory to use
--output path     output file for next input file (also: -o)
WARNING: like its counterpart strip, by default files are overwritten! 🚨 bestie please read that twice. your originals are gone unless you pass -o. not me crying over your lost source. 😭

πŸ’– DESCRIPTION πŸ’–

this program reduces the filesize of perl sources. like, whenever you need it β€” for example, before bundling them using PAR, App::Staticperl, or when you're in a situation where disk space is premium (such as within firmwares, boot floppies etc.). tiny disk, big dreams. 🧚

how does it do it? by removing unnecessary whitespace, commands, POD and a few other things. slay, honestly. ✨

by default it works through the list of files given on the commandline, strips them and writes them again. the way that it just... rewrites your files in place. πŸ™ˆ this behaviour can be influenced via switches, thank god.


🌸 OPTIONS 🌸

  • --verbose, -v β€” increases verbosity. highly recommended for interactive use, fr fr β€” you want to see what's happening. πŸ‘€
  • --output path, -o path β€” write the stripped contents of the following files on the commandline to this path, instead of overwriting the original file. iconic behaviour, honestly. this can be used to copy files instead of (destructively) overwriting them, by specifying -o before each file, e.g.:
perlstrip -o strippedfile origsource
  • --size, -s β€” optimise for size instead of for compressibility. the default is to optimise the file for later compression. optimising for size makes the raw file size smaller, but might compress a bit worse. so like, pick your fighter. πŸ’€
  • --cache, -c β€” stripping files can take a very long time. when this option is enabled, perlstrip will cache larger files in a special directory (default: ~/.cache/perlstrip), to improve repeated calls to strip sources. honestly? main character energy for repeated work. πŸ‘‘ this is mainly useful when you strip a whole perl installation repeatedly.
  • --cache-dir path β€” enables caching, but uses an alternative cache directory (which will be created if it doesn't exist yet). cute, custom, and it makes the folder for you. 🫢

πŸ”₯ SEE ALSO πŸ”₯

App::Staticperl, Perl::Squish. go read those too, bestie, they're the extended universe. ⭐


πŸ’œ AUTHOR πŸ’œ

 Marc Lehmann <schmorp@schmorp.de>
 http://software.schmorp.de/pkg/staticperl.html

give the man his flowers, he wrote the whole thing. 🌸


okay that's the page!! and for the lil sign-off: this beauty is from perl v5.42.3, dated 2023-08-03, and it's filed under PERLSTRIP(1) β€” so if you need to find it again, that's your vibe check reference. periodt. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from