PERL(1)

๐Ÿ“ฆ
version 5.38.2 ยท 2 versions
, in ubuntu noble

๐Ÿ’– perl ๐Ÿ’–

okay so bestie, welcome to the Perl 5 language interpreter โœจ this is the main character of the whole Perl universe, and yes it's a LOT, but we're gonna get through it together, no cap.


โœจ NAME โœจ

perl โ€” The Perl 5 language interpreter ๐Ÿ’…


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

here's the vibe check, the whole menu of flags, literally all of 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 ]...

want the tea on every single one of these options? run perldoc perlrun bestie, that's where it all lives ๐Ÿซถ


๐Ÿฆ‹ GETTING HELP ๐Ÿฆ‹

perldoc is the program that hands you ALL the documentation that ships with Perl. And if you want even more docs, tutorials, and actual community support, it's all online at <https://www.perl.org/> ๐ŸŒˆ

new to Perl? start here: run perldoc perlintro โ€” it's the beginner-friendly general intro and gives you the background so you can actually navigate the rest of Perl's extensive (read: enormous) documentation without spiraling ๐Ÿ˜ญ. And run perldoc perldoc to learn all the extra cute stuff you can do with perldoc โœจ

also, because nobody wants to scroll forever, the Perl manual got split up into several sections. iconic organisational behaviour tbh ๐Ÿ‘‘

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 โœ๏ธ
  • 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 [a-z] ๐Ÿ”ค
  • 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 ๐ŸŽญ
  • perlclass โ€” Perl class syntax ๐Ÿ›๏ธ
    • 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 โš™๏ธ
  • 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

  • perlhist โ€” the Perl history records, aka the whole lore timeline ๐Ÿ“œ
  • perldelta โ€” Perl changes since previous version
  • perl5381delta โ€” Perl changes in version 5.38.1
  • perl5380delta โ€” Perl changes in version 5.38.0
  • perl5363delta โ€” Perl changes in version 5.36.3
  • perl5362delta โ€” Perl changes in version 5.36.2
  • perl5361delta โ€” Perl changes in version 5.36.1
  • perl5360delta โ€” Perl changes in version 5.36.0
  • perl5343delta โ€” Perl changes in version 5.34.3
  • perl5342delta โ€” Perl changes in version 5.34.2
  • 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

๐ŸŽ€ Miscellaneous

  • perlbook โ€” Perl book information, for when u want the physical lore ๐Ÿ“š
  • perlcommunity โ€” Perl community information, aka where ur people are ๐Ÿซถ
  • 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

๐ŸŒ Language-Specific

  • 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

  • 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

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

okay so on Debian systems specifically, bestie, u gotta install the perl-doc package โ€” that's the one holding the majority of the standard Perl documentation plus the perldoc program itself. no perl-doc, no docs. that's the vibe ๐Ÿ’…

There's also extensive additional documentation for Perl modules out there โ€” both the ones shipped with Perl and third-party modules that got packaged or installed locally. โœจ

U should be able to peek at Perl's documentation with ur man(1) program or with perldoc(1). ๐Ÿซถ

Lowkey important: some documentation just isn't available as man pages, so if man can't find a cross-reference, try it with perldoc instead. perldoc can also drop u straight into the docs for functions โ€” that's the -f switch, iykyk. For all the other helpful options perldoc has to offer, go look at "perldoc --help" (or "perldoc perldoc", or "man perldoc"). ๐Ÿ’–

And generally? If something strange went wrong with ur program and ur not sure where to even look for help โ€” try making ur code comply with use strict and use warnings. These two will often point out exactly where the trouble is. periodt. ๐Ÿ‘‘


๐Ÿ’– DESCRIPTION ๐Ÿ’–

Perl officially stands for Practical Extraction and Report Language โ€” except when it doesn't. ๐Ÿ™ˆ

So back in the day, Perl was originally a language optimized for scanning arbitrary text files, extracting information from those text files, and printing reports based on that information. And then it quickly became a genuinely good language for many system management tasks too. Over the years, Perl has grown into a general-purpose programming language. It's widely used for everything from quick "one-liners" all the way to full-scale application development. no cap. ๐ŸŒˆ

The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal). That's the whole design philosophy bestie. It combines โ€” in the author's opinion, anyway โ€” some of the best features of sed, awk, and sh, which makes it familiar and easy to use for Unix users who wanna whip up quick solutions to annoying problems. โญ

Its general-purpose programming facilities support procedural, functional, and object-oriented programming paradigms โ€” which makes Perl a comfortable language for the long haul on major projects, whatever ur bent. ๐Ÿ’…

And 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, 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. ๐Ÿ˜Œ


๐ŸŒธ AVAILABILITY ๐ŸŒธ

Perl is available for most operating systems, including virtually all Unix-like platforms. For the full listing, see "Supported Platforms" in perlport. ๐Ÿ–ฅ๏ธโœจ


๐ŸŒฟ ENVIRONMENT ๐ŸŒฟ

See "ENVIRONMENT" in perlrun.


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

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

If ur Perl success stories and testimonials might be of help to others who wish to advocate the use of Perl in their applications, or if u just wanna simply express ur 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 ๐Ÿฉบ

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's enabled by default when u say "use v5.35" (or higher). U can also use the -w flag, but its use is normally discouraged, because it gets applied to all executed Perl code โ€” including code that's not under ur control. ๐Ÿ˜ฌ

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 u 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. โš ๏ธ

And did we mention that u should definitely consider using the use warnings pragma? ๐Ÿ˜ญ just do it bestie

๐Ÿซ  BUGS ๐Ÿซ 

okay bestie, sit down, we gotta talk about the messy parts. ๐Ÿ’…

  • the whole vibe that the use warnings pragma implies? yeah, it's not mandatory. it's giving "suggestion, not a rule," and we just have to live with that.
  • Perl is fully at the mercy of whatever your machine thinks certain operations mean โ€” like type casting, atof(), and floating-point output with sprintf(). so like, if your box is weird, Perl's gonna be weird. no cap. ๐Ÿ˜ญ
  • if your stdio needs a seek or an eof between reads and writes on a particular stream, then so does Perl. (this does not apply to sysread() and syswrite() โ€” those two are built different ๐Ÿซถ)
  • so here's the tea: none of the built-in data types have any arbitrary size limits (apart from, y'know, memory size itself), BUT there are still a few arbitrary limits lurking:
    • a given variable name may not be longer than 251 characters. yes, 251. very specific, don't ask.
    • the line numbers that diagnostics display are internally stored as short integers, so they max out at 65535 (and higher numbers are usually affected by wraparound, which is the code equivalent of your brain buffering ๐Ÿ˜ตโ€๐Ÿ’ซ)

got a bug to report? please do, we love that for you. make sure you include the full configuration information โ€” the stuff that the myconfig program spits out in the perl source tree, or the stuff from perl -V โ€” and send it here:

https://github.com/Perl/perl5/issues

and finally, the biggest secret of them all: 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. (spoiler: it's a lot. it's so many. it's honestly iconic. ๐Ÿ‘‘)

The three principal virtues of a programmer are Laziness, Impatience, and Hubris. See the Camel Book for why. ๐Ÿชโœจ


and that's the whole page, bestie!! ๐ŸŽ€ this was perl version 5.38.2, dated 2026-09-14, and it's filed under PERL(1). go forth and slay your one-liners, ily ๐Ÿ’–๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from