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 |
| 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 |
| Launch interactive REPL (requires ‘shell’ feature) |
| 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 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) |
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, same as PPERL_DAEMON=1 |
| Reuse a per-script template, same as PPERL_DAEMON=2 |
| 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/
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 (empty if |
|
|
Run pperl -V to see all values for the current binary.