PERL(1)

๐Ÿ“ฆ
version 5.36.0 ยท 2 versions
, in debian bookworm

๐Ÿ’… PERL(1) ๐Ÿ’… โ€” the Perl Programmers Reference Guide

okay so bestie, welcome to PERL(1), aka the big one, aka the man page for the Perl 5 language interpreter, straight out of the Perl Programmers Reference Guide. it's giving legendary. it's giving ancient. it's giving literally runs half the internet. let's get into it ๐Ÿ’–


โœจ NAME โœจ

perl โ€” The Perl 5 language interpreter ๐Ÿช


๐ŸŒธ SYNOPSIS ๐ŸŒธ

like, here's the whole vibe of how you call it:

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 ]...

okay so that's a LOT of little letters, and every single one of them matters. if you want the full tea on what they all do, run:

perldoc perlrun

that's your girl for every option and its lore. ๐Ÿ’…


๐Ÿซถ GETTING HELP ๐Ÿซถ

so the perldoc program is your โœจmain characterโœจ access point to all the documentation that ships with Perl. and if you want even more docs, tutorials, and community support, it's all online at <https://www.perl.org/>. no cap. ๐ŸŒˆ

if you're brand new to Perl, bestie, start here: run perldoc perlintro. it's the general intro for beginners, and it gives you the background you need to actually navigate the rest of Perl's extensive (read: absolutely enormous, iconic, intimidating) documentation. and run perldoc perldoc to learn all the other cute things you can do with perldoc. ๐ŸŽ€

and for ease of access, the Perl manual has been split up into several sections. here's the whole map:

๐Ÿ“š Overview

  • perl โ€” Perl overview (this section, hi, you're here ๐Ÿ‘‹)
  • 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
  • perldata โ€” Perl data structures
  • perlop โ€” Perl operators and precedence
  • 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
  • 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 โ€” Internal replacements for 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
  • 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

okay this part is the โœจreceiptsโœจ section, aka every single version of Perl ever, documented for eternity:

  • perlhist โ€” Perl history records
  • perldelta โ€” Perl changes since previous version
  • perl5341delta โ€” Perl changes in version 5.34.1
  • perl5340delta โ€” Perl changes in version 5.34.0
  • perl5321delta โ€” Perl changes in version 5.32.1
  • perl5320delta โ€” Perl changes in version 5.32.0
  • perl5303delta โ€” Perl changes in version 5.30.3
  • perl5302delta โ€” Perl changes in version 5.30.2
  • perl5301delta โ€” Perl changes in version 5.30.1
  • perl5300delta โ€” Perl changes in version 5.30.0
  • perl5283delta โ€” Perl changes in version 5.28.3
  • perl5282delta โ€” Perl changes in version 5.28.2
  • perl5281delta โ€” Perl changes in version 5.28.1
  • perl5280delta โ€” Perl changes in version 5.28.0
  • perl5263delta โ€” Perl changes in version 5.26.3
  • perl5262delta โ€” Perl changes in version 5.26.2
  • perl5261delta โ€” Perl changes in version 5.26.1
  • perl5260delta โ€” Perl changes in version 5.26.0
  • perl5244delta โ€” Perl changes in version 5.24.4
  • perl5243delta โ€” Perl changes in version 5.24.3
  • perl5242delta โ€” Perl changes in version 5.24.2
  • perl5241delta โ€” Perl changes in version 5.24.1
  • perl5240delta โ€” Perl changes in version 5.24.0
  • perl5224delta โ€” Perl changes in version 5.22.4
  • perl5223delta โ€” Perl changes in version 5.22.3
  • perl5222delta โ€” Perl changes in version 5.22.2
  • perl5221delta โ€” Perl changes in version 5.22.1
  • perl5220delta โ€” Perl changes in version 5.22.0
  • perl5203delta โ€” Perl changes in version 5.20.3
  • perl5202delta โ€” Perl changes in version 5.20.2
  • perl5201delta โ€” Perl changes in version 5.20.1
  • perl5200delta โ€” Perl changes in version 5.20.0
  • perl5184delta โ€” Perl changes in version 5.18.4
  • perl5182delta โ€” Perl changes in version 5.18.2
  • perl5181delta โ€” Perl changes in version 5.18.1
  • perl5180delta โ€” Perl changes in version 5.18.0
  • perl5163delta โ€” Perl changes in version 5.16.3
  • perl5162delta โ€” Perl changes in version 5.16.2
  • perl5161delta โ€” Perl changes in version 5.16.1
  • perl5160delta โ€” Perl changes in version 5.16.0
  • perl5144delta โ€” Perl changes in version 5.14.4
  • perl5143delta โ€” Perl changes in version 5.14.3
  • perl5142delta โ€” Perl changes in version 5.14.2
  • perl5141delta โ€” Perl changes in version 5.14.1
  • perl5140delta โ€” Perl changes in version 5.14.0
  • perl5125delta โ€” Perl changes in version 5.12.5
  • perl5124delta โ€” Perl changes in version 5.12.4
  • perl5123delta โ€” Perl changes in version 5.12.3
  • perl5122delta โ€” Perl changes in version 5.12.2
  • perl5121delta โ€” Perl changes in version 5.12.1
  • perl5120delta โ€” Perl changes in version 5.12.0
  • perl5101delta โ€” Perl changes in version 5.10.1
  • perl5100delta โ€” Perl changes in version 5.10.0
  • perl589delta โ€” Perl changes in version 5.8.9
  • perl588delta โ€” Perl changes in version 5.8.8
  • perl587delta โ€” Perl changes in version 5.8.7
  • perl586delta โ€” Perl changes in version 5.8.6
  • perl585delta โ€” Perl changes in version 5.8.5
  • perl584delta โ€” Perl changes in version 5.8.4
  • perl583delta โ€” Perl changes in version 5.8.3
  • perl582delta โ€” Perl changes in version 5.8.2
  • perl581delta โ€” Perl changes in version 5.8.1
  • perl58delta โ€” Perl changes in version 5.8.0
  • perl561delta โ€” Perl changes in version 5.6.1
  • perl56delta โ€” Perl changes in version 5.6
  • perl5005delta โ€” Perl changes in version 5.005
  • perl5004delta โ€” Perl changes in version 5.004
like, that's sixty-something version docs. it's giving archival queen. don't skip them, they're history ๐Ÿ’€

๐ŸŽ€ Miscellaneous

  • perlbook โ€” Perl book information
  • perlcommunity โ€” Perl community information
  • perldoc โ€” Look up Perl documentation in Pod format
  • perlexperiment โ€” A listing of experimental features in Perl
  • perlartistic โ€” Perl Artistic License
  • perlgpl โ€” GNU General Public License

and that's the map, bestie. ๐ŸŒŸ more coming in part 2, don't go anywhere ๐Ÿ‘‘

๐ŸŒ Language-Specific ๐ŸŒธ

These are the localized perldoc pages, for when English isn't the vibe:

  • 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 OS has its own little lore drop:

  • 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 ๐Ÿชฆ

RIP to these, they're just placeholders now, no content bestie:

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

On Debian systems, you need to install the perl-doc package which contains the majority of the standard Perl documentation and the perldoc program.

There's also SO much extra documentation for Perl modules out there โ€” both the ones distributed with Perl and third-party modules that are packaged or locally installed. The library is stacked, no cap. ๐Ÿ“š

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

Some documentation is not available as man pages, so if a cross-reference is not found by man, try it with perldoc. Perldoc can also take you directly to documentation for functions (with the -f switch). See perldoc --help (or perldoc perldoc or man perldoc) for other helpful options perldoc has to offer. It's giving personal tour guide fr. ๐Ÿซถ

In general, if something strange has gone wrong with your program and you're not sure where you should look for help, try making your code comply with use strict and use warnings. These will often point out exactly where the trouble is. They're literally the group chat that tells you what you did wrong. ๐Ÿ˜ญ

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

Perl officially stands for Practical Extraction and Report Language, except when it doesn't. ๐Ÿ’…

Perl was originally a language optimized for scanning arbitrary text files, extracting information from those text files, and printing reports based on that information. It quickly became a good language for many system management tasks. Over the years, Perl has grown into a general-purpose programming language. It's widely used for everything from quick "one-liners" to full-scale application development.

The language is intended 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, making it familiar and easy to use for Unix users to whip up quick solutions to annoying problems. Its general-purpose programming facilities support procedural, functional, and object-oriented programming paradigms, making Perl a comfortable language for the long haul on major projects, whatever your bent.

Perl's roots in text processing haven't 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, collected in the CPAN, provide ready-made solutions to an astounding array of problems. When they haven't set the standard themselves, they steal from the best -- just like Perl itself.

๐ŸŒˆ 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.

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

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

If your Perl success stories and testimonials may be of help to others who wish to advocate the use of Perl in their applications, or if you wish 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" above is a reference to the built-in variable of the same name; see perlvar for more information.

๐Ÿ’– SEE ALSO ๐Ÿ’–

๐Ÿ”ฅ DIAGNOSTICS ๐Ÿ”ฅ

Using the use strict pragma ensures that all variables are properly declared and prevents other misuses of legacy Perl features. These 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). One 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.

Bestie, the -w flag is the messy ex you keep going back to โ€” normally discouraged, okay? ๐Ÿšฉ

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? ๐Ÿ˜ญ (we did. we're saying it again. it's iconic.)

๐Ÿ’€ BUGS ๐Ÿ’€

The behavior implied by the use warnings pragma is not mandatory.

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, and Hubris. See the Camel Book for why.


That's the whole page bestie!! ๐ŸŽ€ This was perl version v5.36.0, dated 2026-09-29, and it lives at PERL(1). Go forth and write something unhinged and beautiful, ily ๐Ÿ’œโœจ

๐Ÿ“ฆ where this page comes from