Ξεκινώντας#
Εγκατάσταση#
Κατεβάστε εκτελέσιμα και βρείτε τεκμηρίωση στο perl.petamem.com.
Dynamic and static binaries#
pperl comes in two linkages.
The dynamically linked binary uses the system’s C library and loads the C libraries its modules need when they are first used: OpenSSL for Net::SSLeay, libxml2 for XML::LibXML, liblmdb for DB_File, and so on. A module whose library is not installed fails to load with a message naming the library and how to install it. The binary needs a C library at least as new as the one it was built with; on an older system, build pperl there.
The static binary contains everything it runs with and needs nothing installed, on any Linux of its architecture. It cannot load a C library at run time, so it leaves out the modules that work only through one:
TLS and cryptography: Net::SSLeay, IO::Socket::SSL, Crypt::OpenSSL::*, Crypt::PK::Ed25519
XML: XML::LibXML, XML::LibXSLT, XML::Parser
Math::GMP; bzip2 compression (Compress::Raw::Bzip2, IO::Compress::Bzip2, IO::Uncompress::Bunzip2)
DB_File, GDBM_File, NDBM_File, ODBM_File and LMDB_File (SDBM_File is there)
Cairo, GD, SDL2, Imager’s FreeType fonts, Peta::WebGPU
calling C libraries from Perl: Peta::FFI and the bindings built on it, FFI::Platypus, and the database drivers over them (DBD::SQLite, DBD::Pg, DBD::MariaDB, DBD::Sybase). Peta::FFI::Libc, which calls the C library inside pperl, is there.
Loading one of them fails at once and says why:
Can't locate Net/SSLeay.pm in @INC (you may need to install the Net::SSLeay module) (not supported by a static pperl, which cannot load libssl)
A copy of the module elsewhere on @INC is not tried. Everything else, zlib compression, the digests and the rest of perl’s library included, works as in the dynamic binary. pperl -V:usedl tells them apart: usedl='define' for the dynamic binary, usedl='undef' for the static one.
Πρώτο σενάριο#
#!/usr/bin/env pperl
print "Hello from PetaPerl!\n";
Επιλογές γραμμής εντολών#
Επιλογή | Περιγραφή |
|---|---|
| Εκτέλεση μονογραμμικού |
| Όπως το |
| Προσθέτει το |
| Έλεγχος μόνο της σύνταξης |
| Ενεργοποίηση προειδοποιήσεων |
| Εμφάνιση έκδοσης |
| Εμφάνιση των ρυθμίσεων, του |
| Απενεργοποίηση μεταγλώττισης JIT |
| Απενεργοποίηση αυτόματης παραλληλοποίησης |
Δείτε τις επιλογές CLI για την πλήρη λίστα επιλογών.
Σημειώσεις#
Οι προεπιλογές ταιριάζουν με την perl: τα σύγχρονα χαρακτηριστικά (
say,stateκαι παρόμοια) ενεργοποιούνται μεuse v5.44;σε σενάρια ή με-Eγια μονογραμμικάΤα αρθρώματα XS δεν υποστηρίζονται· παρέχονται εγγενείς υλοποιήσεις σε Rust για τα κοινόχρηστα αρθρώματα
Οι διαδρομές αναζήτησης αρθρωμάτων λειτουργούν όπως στην perl: το
-Iκαι η μεταβλητή περιβάλλοντοςPERL5LIBλαμβάνονται υπόψη· τοPPERL5LIBπαρέχει επιπλέον διαδρομές αποκλειστικά για το pperl (δείτε Επιλογές CLI)