CLI options#
pperl accepts a small set of command-line flags. Most are perl-compatible; a handful are pperl-specific (JIT, parallelism). The authoritative list is whatever pperl --help prints; the tables below show those flags, extracted from the interpreter source and rendered here on every documentation build.
Note
The actual pperl --help output on the terminal is always in English - the binary does not localise help strings. Translated documentation shows the same flags with descriptions in the page’s language so readers can study what each flag does; flag tokens (-T, --threads=N, …) are always verbatim.
PetaPerl - Next-generation Perl 5 runtime
Usage#
pperl [OPTIONS] [--] [SCRIPT [ARGS...]]
pperl -e 'code'
pperl -E 'code'
Perl-compatible options#
Flag | Description |
|---|---|
| Execute one-liner |
| Like -e, but enable all optional features (say, …) |
| use module before executing (-MO=Deparse, -Mstrict) |
| use module () before executing (no imports) |
| Prepend directory to @INC |
| Check syntax only, don’t execute |
| Enable warnings |
| Enable all warnings, even under ‘no warnings’ |
| Disable all warnings, even under ‘use warnings’ |
| Turn the program’s -name[=value] arguments into variables |
| Loop over input lines (no auto-print), like while(<>) |
| Loop over input lines and auto-print, like a sed filter |
| Autosplit each line into @F (with -n or -p) |
| Set the -a split pattern (implies -a) |
| Auto-chomp input, set output record separator |
| Set input record separator (-0 = NUL, -00 = paragraph) |
| Edit files in place (optional backup extension) |
| Taint mode (forced) |
| Taint warnings |
| Show version information |
| Show configuration summary, %ENV and @INC |
| Show the value of a Config key, e.g. -V:archname |
| Interactive REPL (psh) - NOT IMPLEMENTED YET; the switch is reserved and currently exits non-zero |
| Show this help message |
pperl-specific options#
Flag | Description |
|---|---|
| Show performance statistics (time, memory) |
Runtime options#
Flag | Description |
|---|---|
| Disable JIT compilation (on by default) |
| Disable only the regex JIT, leaving the op JIT on |
| Disable auto-parallelization (on by default) |
| Parallel thread count. SPEC is one of: |
| all physical cores (DEFAULT) |
| all logical cores (hyperthreads) |
| physical minus N (min 1) |
| logical minus N (min 1) |
| P percent of logical cores |
| an explicit count |
| Minimum iterations to parallelize (default: 100) |
| Print JIT summary to stderr at exit (see also PPERL_JIT_LOG) |
Regex JIT#
The regex JIT is separate from the op JIT and on by default. It compiles a pattern only after that pattern has matched against 64 KiB of subject, and only for the shapes it supports; anything else runs on the standard engine and is refused once, at pattern-compile time.
Flag | Description |
|---|---|
| Disable the regex JIT, leaving the op JIT on. Costs nothing to leave on for workloads it helps, but a program whose patterns are ALL refused still pays a small per-match dispatch cost (~3%); turning it off removes that path completely. –no-jit disables it too, along with the op JIT. |
| The same switch as an environment variable, for wrapping a program you cannot pass flags to. PPERL_RXJIT=1 forces it ON even under –no-jit (a diagnostic, not a normal posture). |
| Report, per pattern, whether it was admitted, refused (with the reason) or compiled. Run this FIRST: it is what tells you whether a given workload is one of the ones worth disabling. |
Module installation#
Flag | Description |
|---|---|
| Install CPAN distributions for pperl. Everything after this flag goes to the installer. Pure Perl only: pperl runs no XS. Modules built into the binary are reported as already installed, so they are never rebuilt. |
| Install into the system overlay instead of the per-user tree ($PPERL_HOME, default ~/.pperl) |
| Write pperl’s built-in module inventory as stub .pm files, so any installer’s on-disk version probe reads pperl’s inventory instead of the host perl’s. Put it on an INSTALLER’s path only, never on PPERL5LIB. |
Daemon options#
Flag | Description |
|---|---|
| Run the fast-start daemon in the foreground |
| Start the daemon in the background |
| Stop the running daemon for this binary |
| Show daemon status and cached script templates |
| Daemon exits after SECS without a request (default: 900) |
| Cache at most N script templates (default: 100) |
| Drop all cached script templates |
| Drop the cached template for FILE only |
| Route this run through the daemon. With a script file that means reusing its cached compiled image; the script itself stays a normal argument: pperl –via-daemon myscript.pl (PPERL_DAEMON=2 does the same without the flag) |
| Force the shared zygote: fork a ready interpreter but compile the script every run. For testing the daemon; it saves little. Same as PPERL_DAEMON=1 |
| Print the binary identity that keys the daemon socket |
Examples#
pperl script.pl
Execute a Perl script
pperl -E 'say "Hello!"'
Execute a one-liner (-E enables say, state, etc.)
pperl -c script.pl
Check script syntax without executing
pperl script.pl arg1 arg2
Pass arguments to script (@ARGV)
For more information, see: https://perl.petamem.com/docs/eng/
Report bugs at: https://github.com/petamem/pperl-bugtracker/issues
Module search paths: -I, PERL5LIB, @INC#
-I dir prepends dir to @INC, exactly like perl. Entries from -I and from the PERL5LIB environment variable (PERLLIB as the fallback; both ignored under taint mode) are additionally expanded: if the directory has versioned children (5.44.99, 5.40.0, …), those are added around the entry, nearest perl version first. This makes local::lib- and Carton-style trees built by a real perl work unmodified.
Two deliberate differences from perl:
No architecture subdirectories. perl would also add
dir/5.44/x86_64-linux-style children; pperl never does. It runs no compiled XS objects, so those directories hold nothing it could use, and skipping them avoids loading.pmwrappers that would die trying to bootstrap.sofiles.Native modules win over every
@INCentry. Modules built into the pperl binary (seePPERL_MODSbelow) are served directly byrequire; a same-name.pmon disk is never loaded in front of them, no matter what-Isays.
Two pperl-private search locations exist for parallel installations, so a module can be provided to pperl WITHOUT touching the shared perl trees:
The
PPERL5LIBenvironment variable: same syntax and expansion asPERL5LIB, honored immediately before it.The pperl overlay trees, probed before every host perl tree:
/usr/local/share/pperl/site_perl(local overrides),/usr/share/pperl/site_perland/usr/share/pperl/vendor_perl(packaged), each optionally with versioned children.
A .pm in either location outranks all host trees for pperl only - the host perl never looks there. Neither can outrank a module built into the binary.
The rest of @INC is built by probing the host’s standard library trees (Arch, Debian and Fedora layouts) rather than baking one distribution’s paths into the binary; pperl -V prints the real result. Details and rationale: differences from upstream and the @INC reference in program input.
Environment variables#
pperl sets several environment variables inside the process it runs, so scripts can introspect the running interpreter:
Variable | Meaning |
|---|---|
| Version string (same as |
| Comma-separated list of compiled-in Cargo features |
| Comma-separated |
| Shell integration flavor ( |
|
|
Run pperl -V to see all values for the current binary.