PERL(1)

๐Ÿ’– PERL(1) ๐Ÿ’–

okay so this is the perl page from the Perl Programmers Reference Guide, and the vibe is: Perl 5 language interpreter, but make it bestie-coded. โœจ

โœจ NAME โœจ

perl โ€” The Perl 5 language interpreter. no cap, that's the whole name section. ๐Ÿ’…

๐ŸŒธ SYNOPSIS ๐ŸŒธ

       perl [ -sTtuUWX ]
               [ -hv ] [ -V[:configvar] ]
               [ -cw ] [ -d[t][:debugger] ] [ -D[number/list] ]
               [ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal/hexadecimal] ]
               [ -Idir ] [ -m[-]module ] [ -M[-]'module...' ] [ -f ]
               [ -C [number/list] ]
               [ -S ]
               [ -x[dir] ]
               [ -i[extension] ]
               [ [-e|-E] 'command' ] [ -- ] [ programfile ] [ argument ]...

For more information on these options, you can run perldoc perlrun. ๐Ÿซถ

๐Ÿซถ GETTING HELP ๐Ÿซถ

perldoc is the program that gives you access to all the documentation that comes with Perl. You can get more documentation, tutorials, and community support online at https://www.perl.org/. ๐ŸŒˆ

If you're new to Perl, start by running perldoc perlintro โ€” it's a general intro for beginners and gives you some background to help you navigate the rest of Perl's extensive documentation. Run perldoc perldoc to learn more things you can do with perldoc. ๐Ÿ’–

For ease of access, the Perl manual has been split up into several sections. โœจ

๐ŸŒธ Overview ๐ŸŒธ

  • perl โ€” Perl overview (this section)
  • perlintro โ€” Perl introduction for beginners
  • perlrun โ€” Perl execution and options
  • perltoc โ€” Perl documentation table of contents

๐ŸŽ€ Tutorials ๐ŸŽ€

  • perlreftut โ€” Perl references short introduction
  • perldsc โ€” Perl data structures intro
  • perllol โ€” Perl data structures: arrays of arrays
  • perlrequick โ€” Perl regular expressions quick start
  • perlretut โ€” Perl regular expressions tutorial
  • perlootut โ€” Perl OO tutorial for beginners
  • perlperf โ€” Perl Performance and Optimization Techniques
  • perlstyle โ€” Perl style guide
  • perlcheat โ€” Perl cheat sheet
  • perltrap โ€” Perl traps for the unwary
  • perldebtut โ€” Perl debugging tutorial
  • perlfaq โ€” Perl frequently asked questions
    • perlfaq1 โ€” General Questions About Perl
    • perlfaq2 โ€” Obtaining and Learning about Perl
    • perlfaq3 โ€” Programming Tools
    • perlfaq4 โ€” Data Manipulation
    • perlfaq5 โ€” Files and Formats
    • perlfaq6 โ€” Regexes
    • perlfaq7 โ€” Perl Language Issues
    • perlfaq8 โ€” System Interaction
    • perlfaq9 โ€” Networking

๐Ÿ‘‘ Reference Manual ๐Ÿ‘‘

  • perlsyn โ€” Perl syntax: declarations, statements, comments
  • perldata โ€” Perl data structures
  • perlop โ€” Perl expressions: operators, precedence, string literals
  • perlsub โ€” Perl subroutines
  • perlfunc โ€” Perl built-in functions
    • perlopentut โ€” Perl open() tutorial
    • perlpacktut โ€” Perl pack() and unpack() tutorial
  • perlpod โ€” Perl plain old documentation
  • perlpodspec โ€” Perl plain old documentation format specification
  • perldocstyle โ€” Perl style guide for core docs
  • perlpodstyle โ€” Perl POD style guide
  • perldiag โ€” Perl diagnostic messages
  • perldeprecation โ€” Perl deprecations
  • perllexwarn โ€” Perl warnings and their control
  • perldebug โ€” Perl debugging
  • perlvar โ€” Perl predefined variables
  • perlre โ€” Perl regular expressions, the rest of the story
  • perlrebackslash โ€” Perl regular expression backslash sequences
  • perlrecharclass โ€” Perl regular expression character classes
  • perlreref โ€” Perl regular expressions quick reference
  • perlref โ€” Perl references, the rest of the story
  • perlform โ€” Perl formats
  • perlobj โ€” Perl objects
  • perltie โ€” Perl objects hidden behind simple variables
    • perldbmfilter โ€” Perl DBM filters
  • perlclass โ€” Perl class syntax
  • perlipc โ€” Perl interprocess communication
  • perlfork โ€” Perl fork() information
  • perlnumber โ€” Perl number semantics
  • perlthrtut โ€” Perl threads tutorial
  • perlport โ€” Perl portability guide
  • perllocale โ€” Perl locale support
  • perluniintro โ€” Perl Unicode introduction
  • perlunicode โ€” Perl Unicode support
  • perlunicook โ€” Perl Unicode cookbook
  • perlunifaq โ€” Perl Unicode FAQ
  • perluniprops โ€” Index of Unicode properties in Perl
  • perlunitut โ€” Perl Unicode tutorial
  • perlebcdic โ€” Considerations for running Perl on EBCDIC platforms
  • perlsec โ€” Perl security
  • perlsecpolicy โ€” Perl security report handling policy
  • perlmod โ€” Perl modules: how they work
  • perlmodlib โ€” Perl modules: how to write and use
  • perlmodstyle โ€” Perl modules: how to write modules with style
  • perlmodinstall โ€” Perl modules: how to install from CPAN
  • perlnewmod โ€” Perl modules: preparing a new module for distribution
  • perlpragma โ€” Perl modules: writing a user pragma
  • perlutil โ€” utilities packaged with the Perl distribution
  • perlfilter โ€” Perl source filters
  • perldtrace โ€” Perl's support for DTrace
  • perlglossary โ€” Perl Glossary

๐Ÿงš Internals and C Language Interface ๐Ÿงš

  • perlembed โ€” Perl ways to embed perl in your C or C++ application
  • perldebguts โ€” Perl debugging guts and tips
  • perlxstut โ€” Perl XS tutorial
  • perlxs โ€” Perl XS application programming interface
  • perlxstypemap โ€” Perl XS C/Perl type conversion tools
  • perlclib โ€” Interacting with standard C library functions
  • perlguts โ€” Perl internal functions for those doing extensions
  • perlcall โ€” Perl calling conventions from C
  • perlmroapi โ€” Perl method resolution plugin interface
  • perlreapi โ€” Perl regular expression plugin interface
  • perlreguts โ€” Perl regular expression engine internals
  • perlclassguts โ€” Internals of class syntax
  • perlapi โ€” Perl API listing (autogenerated)
  • perlintern โ€” Perl internal functions (autogenerated)
  • perliol โ€” C API for Perl's implementation of IO in Layers
  • perlapio โ€” Perl internal IO abstraction interface
  • perlhack โ€” Perl hackers guide
  • perlsource โ€” Guide to the Perl source tree
  • perlinterp โ€” Overview of the Perl interpreter source and how it works
  • perlhacktut โ€” Walk through the creation of a simple C code patch
  • perlhacktips โ€” Tips for Perl core C code hacking
  • perlpolicy โ€” Perl development policies
  • perlgov โ€” Perl Rules of Governance
  • perlgit โ€” Using git with the Perl repository

โœจ History โœจ

bestie, this is the lore section ๐Ÿ˜Œ every single time Perl levelled up, someone wrote a whole essay about it, and these are those essays. Newest at the top, chronological, no skips. ๐Ÿ’–

  • perlhist โ€” the actual Perl history records, like the family scrapbook ๐Ÿ“œ
  • perldelta โ€” what changed since the previous version, aka the "what did we just do" note ๐Ÿซถ
  • perl5422delta โ€” the tea on what changed in version 5.42.2
  • perl5421delta โ€” changes in version 5.42.1
  • perl5420delta โ€” changes in version 5.42.0
  • perl5404delta โ€” changes in version 5.40.4
  • perl5403delta โ€” changes in version 5.40.3
  • perl5402delta โ€” changes in version 5.40.2
  • perl5401delta โ€” changes in version 5.40.1
  • perl5400delta โ€” changes in version 5.40.0
  • perl5385delta โ€” changes in version 5.38.5
  • perl5384delta โ€” changes in version 5.38.4
  • perl5383delta โ€” changes in version 5.38.3
  • perl5382delta โ€” changes in version 5.38.2
  • perl5381delta โ€” changes in version 5.38.1
  • perl5380delta โ€” changes in version 5.38.0
  • perl5363delta โ€” changes in version 5.36.3
  • perl5362delta โ€” changes in version 5.36.2
  • perl5361delta โ€” changes in version 5.36.1
  • perl5360delta โ€” changes in version 5.36.0
  • perl5343delta โ€” changes in version 5.34.3
  • perl5342delta โ€” changes in version 5.34.2
  • perl5341delta โ€” changes in version 5.34.1
  • perl5340delta โ€” changes in version 5.34.0
  • perl5321delta โ€” changes in version 5.32.1
  • perl5320delta โ€” changes in version 5.32.0
  • perl5303delta โ€” changes in version 5.30.3
  • perl5302delta โ€” changes in version 5.30.2
  • perl5301delta โ€” changes in version 5.30.1
  • perl5300delta โ€” changes in version 5.30.0
  • perl5283delta โ€” changes in version 5.28.3
  • perl5282delta โ€” changes in version 5.28.2
  • perl5281delta โ€” changes in version 5.28.1
  • perl5280delta โ€” changes in version 5.28.0
  • perl5263delta โ€” changes in version 5.26.3
  • perl5262delta โ€” changes in version 5.26.2
  • perl5261delta โ€” changes in version 5.26.1
  • perl5260delta โ€” changes in version 5.26.0
  • perl5244delta โ€” changes in version 5.24.4
  • perl5243delta โ€” changes in version 5.24.3
  • perl5242delta โ€” changes in version 5.24.2
  • perl5241delta โ€” changes in version 5.24.1
  • perl5240delta โ€” changes in version 5.24.0
  • perl5224delta โ€” changes in version 5.22.4
  • perl5223delta โ€” changes in version 5.22.3
  • perl5222delta โ€” changes in version 5.22.2
  • perl5221delta โ€” changes in version 5.22.1
  • perl5220delta โ€” changes in version 5.22.0
  • perl5203delta โ€” changes in version 5.20.3
  • perl5202delta โ€” changes in version 5.20.2
  • perl5201delta โ€” changes in version 5.20.1
  • perl5200delta โ€” changes in version 5.20.0
  • perl5184delta โ€” changes in version 5.18.4
  • perl5182delta โ€” changes in version 5.18.2
  • perl5181delta โ€” changes in version 5.18.1
  • perl5180delta โ€” changes in version 5.18.0
  • perl5163delta โ€” changes in version 5.16.3
  • perl5162delta โ€” changes in version 5.16.2
  • perl5161delta โ€” changes in version 5.16.1
  • perl5160delta โ€” changes in version 5.16.0
  • perl5144delta โ€” changes in version 5.14.4
  • perl5143delta โ€” changes in version 5.14.3
  • perl5142delta โ€” changes in version 5.14.2
  • perl5141delta โ€” changes in version 5.14.1
  • perl5140delta โ€” changes in version 5.14.0
  • perl5125delta โ€” changes in version 5.12.5
  • perl5124delta โ€” changes in version 5.12.4
  • perl5123delta โ€” changes in version 5.12.3
  • perl5122delta โ€” changes in version 5.12.2
  • perl5121delta โ€” changes in version 5.12.1
  • perl5120delta โ€” changes in version 5.12.0
  • perl5101delta โ€” changes in version 5.10.1
  • perl5100delta โ€” changes in version 5.10.0
  • perl589delta โ€” changes in version 5.8.9
  • perl588delta โ€” changes in version 5.8.8
  • perl587delta โ€” changes in version 5.8.7
  • perl586delta โ€” changes in version 5.8.6
  • perl585delta โ€” changes in version 5.8.5
  • perl584delta โ€” changes in version 5.8.4
  • perl583delta โ€” changes in version 5.8.3
  • perl582delta โ€” changes in version 5.8.2
  • perl581delta โ€” changes in version 5.8.1
  • perl58delta โ€” changes in version 5.8.0
  • perl561delta โ€” changes in version 5.6.1
  • perl56delta โ€” changes in version 5.6
  • perl5005delta โ€” changes in version 5.005
  • perl5004delta โ€” changes in version 5.004

๐ŸŽ€ Miscellaneous ๐ŸŽ€

the grab-bag section, we love her ๐Ÿ’…

  • perlbook โ€” all the Perl book information you could ever want ๐Ÿ“š
  • perlcommunity โ€” where the Perl community hangs out, and how to find them ๐Ÿซถ
  • perldoc โ€” the tool that looks up Perl documentation in Pod format โœจ
  • perlexperiment โ€” a whole listing of the experimental features in Perl ๐Ÿงช
  • perlartistic โ€” the Perl Artistic License ๐Ÿ“œ
  • perlgpl โ€” the GNU General Public License ๐Ÿ“œ

๐ŸŒˆ Language-Specific ๐ŸŒˆ

Perl, but make it multilingual ๐Ÿฆ‹

  • perlcn โ€” Perl for Simplified Chinese (in UTF-8)
  • perljp โ€” Perl for Japanese (in EUC-JP)
  • perlko โ€” Perl for Korean (in EUC-KR)
  • perltw โ€” Perl for Traditional Chinese (in Big5)

๐Ÿ’ป Platform-Specific ๐Ÿ’ป

every platform said "not me being special" and wrote its own notes, so here they all are ๐Ÿ˜ญ

  • perlaix โ€” Perl notes for AIX
  • perlamiga โ€” Perl notes for AmigaOS
  • perlandroid โ€” Perl notes for Android
  • perlbs2000 โ€” Perl notes for POSIX-BC BS2000
  • perlcygwin โ€” Perl notes for Cygwin
  • perlfreebsd โ€” Perl notes for FreeBSD
  • perlhaiku โ€” Perl notes for Haiku
  • perlhpux โ€” Perl notes for HP-UX
  • perlhurd โ€” Perl notes for Hurd
  • perlirix โ€” Perl notes for Irix
  • perllinux โ€” Perl notes for Linux
  • perlmacosx โ€” Perl notes for Mac OS X
  • perlopenbsd โ€” Perl notes for OpenBSD
  • perlos2 โ€” Perl notes for OS/2
  • perlos390 โ€” Perl notes for OS/390
  • perlos400 โ€” Perl notes for OS/400
  • perlplan9 โ€” Perl notes for Plan 9
  • perlqnx โ€” Perl notes for QNX
  • perlriscos โ€” Perl notes for RISC OS
  • perlsolaris โ€” Perl notes for Solaris
  • perlsynology โ€” Perl notes for Synology
  • perltru64 โ€” Perl notes for Tru64
  • perlvms โ€” Perl notes for VMS
  • perlvos โ€” Perl notes for Stratus VOS
  • perlwin32 โ€” Perl notes for Windows

๐Ÿ’€ Stubs for Deleted Documents ๐Ÿ’€

rest in peace, besties ๐Ÿ•ฏ๏ธ these pages got deleted, so what's left are just stubs โ€” ghosts of docs past, lowkey giving haunted library energy:

  • perlboot
  • perlbot
  • perlrepository
  • perltodo
  • perltooc
  • perltoot

heads up if you're on Debian: you need to install the perl-doc package, because that is what contains the majority of the standard Perl documentation and the perldoc program. no package, no docs, no vibes ๐Ÿ˜ค

There's also extensive extra documentation for Perl modules โ€” and not just the ones shipped with Perl, but third-party modules too, whether they're packaged up or locally installed. ๐Ÿ“ฆ

You should be able to view Perl's documentation with your man(1) program or perldoc(1). Easy.

Some documentation is not available as man pages, okay, so if a cross-reference doesn't turn up when you man it, try it with perldoc instead. And perldoc can take you straight to the docs for functions โ€” that's with the -f switch ๐Ÿ”ฅ. See perldoc --help (or perldoc perldoc, or man perldoc) for all the other helpful options perldoc has to offer.

In general: if something strange has gone wrong with your program and you're not sure where to even look for help, try making your code comply with use strict and use warnings. Fr fr, these will often point out exactly where the trouble is. ๐ŸŽฏ

๐Ÿ”ฅ DESCRIPTION ๐Ÿ”ฅ

Perl officially stands for Practical Extraction and Report Language... except when it doesn't. ๐Ÿ˜Œ

Perl started out as a language optimized for three things: scanning arbitrary text files, extracting information from those text files, and printing reports based on that information. Pretty quickly it turned out to also be a great language for a ton of system management tasks. And over the years? It grew all the way up into a general-purpose programming language. Now it's widely used for everything from quick "one-liners" to full-scale application development. glow-up of the century, honestly ๐Ÿ’…

The language is meant to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal). It combines โ€” in the author's opinion, anyway โ€” some of the best features of sed, awk, and sh, which makes it familiar and easy for Unix users who just want to whip up quick solutions to annoying problems. And its general-purpose programming facilities support procedural, functional, and object-oriented programming paradigms, which makes Perl a genuinely comfortable language for the long haul on major projects, whatever your bent. ๐Ÿซถ

Perl's roots in text processing have not been forgotten over the years. It still boasts some of the most powerful regular expressions to be found anywhere, and its support for Unicode text is world-class. ๐ŸŒ It handles all kinds of structured text too, through an extensive collection of extensions. Those libraries, all collected in the CPAN, provide ready-made solutions to an astounding array of problems. And when they haven't set the standard themselves, they steal from the best โ€” just like Perl itself. iconic behaviour, no notes. ๐Ÿ‘‘

โœจ AVAILABILITY โœจ

Perl is available for most operating systems, including virtually all Unix-like platforms. ๐Ÿฆ‹ See "Supported Platforms" in perlport for a listing.

๐ŸŒธ ENVIRONMENT ๐ŸŒธ

See "ENVIRONMENT" in perlrun. (yes bestie, the env-var deets live over there, go look ๐Ÿ‘€)

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Larry Wall <larry@wall.org>, with the help of oodles of other folks. ๐Ÿซถ

If your Perl success stories and testimonials might help other people who want to advocate for using Perl in their applications โ€” or if you just want to simply express your gratitude to Larry and the Perl developers โ€” please write to perl-thanks@perl.org . ๐Ÿ’Œ

๐Ÿฆ‹ FILES ๐Ÿฆ‹

  • "@INC" โ€” locations of perl libraries

"@INC" up there is a reference to the built-in variable of the same name; see perlvar for more information.

โญ SEE ALSO โญ

๐Ÿ’– DIAGNOSTICS ๐Ÿ’–

okay bestie, real talk: using use strict is like having a friend who makes sure all variables are properly declared and prevents other misuses of legacy Perl features. iconic behavior, no cap. And these checks are enabled by default within the scope of use v5.12 (or higher).

The use warnings pragma produces some lovely diagnostics. It is enabled by default when you say use v5.35 (or higher). You can also use the -w flag, but its use is normally discouraged, because it gets applied to all executed Perl code, including that not under your control. so likeโ€ฆ itโ€™s giving messy.

lowkey important: see perldiag for explanations of all Perl's diagnostics. The use diagnostics pragma automatically turns Perl's normally terse warnings and errors into these longer forms.

Compilation errors will tell you the line number of the error, with an indication of the next token or token type that was to be examined. (In a script passed to Perl via -e switches, each -e is counted as one line.)

Setuid scripts have additional constraints that can produce error messages such as "Insecure dependency". See perlsec.

Did we mention that you should definitely consider using the use warnings pragma? ๐Ÿ‘€โœจ


๐Ÿ˜ญ BUGS ๐Ÿ˜ญ

The behavior implied by the use warnings pragma is not mandatory. not me finding out itโ€™s optional ๐Ÿ’€

Perl is at the mercy of your machine's definitions of various operations such as type casting, atof(), and floating-point output with sprintf().

If your stdio requires a seek or eof between reads and writes on a particular stream, so does Perl. (This doesn't apply to sysread() and syswrite().)

While none of the built-in data types have any arbitrary size limits (apart from memory size), there are still a few arbitrary limits: a given variable name may not be longer than 251 characters. Line numbers displayed by diagnostics are internally stored as short integers, so they are limited to a maximum of 65535 (higher numbers usually being affected by wraparound).

You may submit your bug reports (be sure to include full configuration information as output by the myconfig program in the perl source tree, or by perl -V) to <https://github.com/Perl/perl5/issues>.

Perl actually stands for Pathologically Eclectic Rubbish Lister, but don't tell anyone I said that. ๐Ÿคซ


๐ŸŒธ NOTES ๐ŸŒธ

The Perl motto is "There's more than one way to do it." Divining how many more is left as an exercise to the reader.

The three principal virtues of a programmer are:

  • Laziness
  • Impatience
  • Hubris

See the Camel Book for why.


okay thatโ€™s the whole vibe, bestie โ€” this page is perl v5.42.3, dated 2026-08-17, and itโ€™s PERL(1). now go forth and slay ๐Ÿ’…โœจ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from