אפשרויות CLI#
pperl מקבל קבוצה קטנה של דגלי שורת פקודה. רובם תואמי perl; מקצתם ייחודיים ל־pperl (JIT, הקבלה, בחירת סביבת ריצה, מטמון bytecode). הרשימה הקובעת היא מה ש־pperl --help מדפיס; הטבלאות שלהלן מציגות את הדגלים האלה, החולצו ממקור המפרש ומוצגים כאן בכל בנייה של התיעוד.
הערה
פלט pperl --help בפועל בטרמינל הוא תמיד באנגלית - הקובץ הבינארי אינו מתרגם את מחרוזות העזרה. התיעוד המתורגם מציג את אותם דגלים עם תיאורים בשפת העמוד כדי שהקוראים יוכלו לעיין בתפקיד של כל דגל; אסימוני הדגלים (-T, --threads=N, …) נשמרים תמיד כפי שהם.
PetaPerl - סביבת ריצה של Perl 5 מהדור הבא
שימוש#
pperl [OPTIONS] [--] [SCRIPT [ARGS...]]
pperl -e 'code'
pperl -E 'code'
אפשרויות תואמות Perl#
דגל | תיאור |
|---|---|
| חד־שורתיים מספריים ושל תאריכים |
| Like -e, but enable all optional features (say, …) |
| use module before executing (-MO=Deparse, -Mstrict) |
| use module () before executing (no imports) |
| מוסיף תיקייה לתחילת @INC |
| בדיקת תחביר בלבד, לא מריץ |
| הפעלת אזהרות |
| 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) |
| בצע chomp אוטומטי לקלט, קבע את מפריד רשומת הפלט |
| Set input record separator (-0 = NUL, -00 = paragraph) |
| Edit files in place (optional backup extension) |
| Taint mode (forced) |
| הפעלת אזהרות |
| הצגת מידע על הגרסה |
| Show configuration summary, %ENV and @INC |
| Show the value of a Config key, e.g. -V:archname |
| Launch interactive REPL (requires »shell« feature) |
| הצגת הודעת עזרה זו |
אפשרויות ייחודיות ל־pperl#
דגל | תיאור |
|---|---|
| הצגת סטטיסטיקת ביצועים (זמן, זיכרון, ops) |
אפשרויות סביבת ריצה#
דגל | תיאור |
|---|---|
| השבתת קומפילציית JIT (פעיל כברירת מחדל) |
| השבתת הקבלה אוטומטית (פעיל כברירת מחדל) |
| 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 |
| מינימום איטרציות להקבלה (ברירת מחדל: 100) |
| Print JIT summary to stderr at exit (see also PPERL_JIT_LOG) |
Daemon options#
דגל | תיאור |
|---|---|
| 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 |
דוגמאות#
pperl script.pl
הרצת סקריפט Perl
pperl -E 'say "Hello!"'
הרצת one-liner (say, state וכו« זמינים תמיד)
pperl -c script.pl
בדיקת תחביר הסקריפט ללא הרצה
pperl script.pl arg1 arg2
העברת ארגומנטים לסקריפט (@ARGV)
למידע נוסף, ראו: https://gl.petatech.eu/petatech/peta-perl
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.
שני הבדלים מכוונים מ־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.
משתני סביבה#
pperl מגדיר מספר משתני סביבה בתוך התהליך שהוא מריץ, כדי שסקריפטים יוכלו לבחון את המפרש הפועל:
משתנה | משמעות |
|---|---|
| מחרוזת גרסה (זהה ל־ |
| רשימת תכונות Cargo משולבות, מופרדות בפסיקים |
| זוגות |
| טעם של אינטגרציית shell (ריק אם תכונת |
|
|
יש להריץ pperl -V כדי לראות את כל הערכים עבור הקובץ הבינארי הנוכחי.