PERL(1)

๐Ÿ“ฆ
version 5.34.0 ยท 2 versions
, in ubuntu jammy

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

okay bestie, sit DOWN, we're reading the perl manpage together and honestly? it's giving main character energy. this is the manual page for perl โ€” The Perl 5 language interpreter ๐Ÿ‘‘


โœจ NAME โœจ

perl โ€” The Perl 5 language interpreter. that's her. that's the whole vibe. ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

like, here's how you summon her:

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 the tea on all these options, run perldoc perlrun. go on, she won't bite ๐Ÿซถ


๐Ÿฆ‹ GETTING HELP ๐Ÿฆ‹

the perldoc program is literally your key to ALL the documentation that ships with Perl. and if you want even more docs, tutorials, and community support online, it's all at <https://www.perl.org/> โ€” no cap. โœจ

if you're new here (welcome, bb ๐ŸŽ€), start with running perldoc perlintro. it's a general intro for beginners and gives you the background you need to navigate the rest of Perl's extensive documentation. like, extensive extensive. run perldoc perldoc to learn more things you can do with perldoc.

and for ease of access, the Perl manual has been split up into several sections. let's get into it ๐Ÿ’–

๐ŸŒˆ Overview

  • perl โ€” Perl overview (this section, hiii you are 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

the lore. the archives. we stan a documented glow-up ๐Ÿ’–

  • perlhist โ€” Perl history records
  • perldelta โ€” Perl changes since previous version
  • 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
  • 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 part 1 bestie ๐Ÿซถ more is coming, don't go anywhere โ€” we're not even done ๐Ÿ’…

๐Ÿ’œ Language-Specific

Like, Perl speaks so many languages and it's giving polyglot royalty:

  • 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

Whatever weird lil machine you're on, bestie, there's a page for that:

  • 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
  • perldos โ€” Perl notes for DOS
  • 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
  • perlmacos โ€” Perl notes for Mac OS (Classic)
  • perlmacosx โ€” Perl notes for Mac OS X
  • perlnetware โ€” Perl notes for NetWare
  • 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

These pages are literally just ghost stubs now, no cap โ€” the docs are gone but the names remain, like a haunted lil hallway:

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

Okay so if you're on a Debian system, heads up bestie: you gotta install the perl-doc package, because that's what has the majority of the standard Perl documentation in it, plus the perldoc program itself. Periodt.

There's also extensive additional documentation for Perl modules โ€” both the ones shipped with Perl and the third-party ones that are packaged up or locally installed. So much lore fr fr.

You should be able to view all of Perl's documentation with your man(1) program or with perldoc(1). ๐Ÿซถ

But some docs are not available as man pages (rude, honestly), so if a cross-reference comes up empty when you hit it with man, try it with perldoc instead. perldoc can also take you directly to documentation for functions โ€” just use the -f switch. Want more helpful options? Run "perldoc --help" (or "perldoc perldoc" or "man perldoc") and it'll show you everything it's got. โœจ

And in general? If something strange has gone wrong with your program and you're like "where do I even look ๐Ÿ˜ญ" โ€” try making your code comply with use strict and use warnings. These will often point out exactly where the trouble is. Iconic behavior.

๐ŸŒˆ 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. Glow-up of the century ngl.

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. Main character energy across every paradigm ๐Ÿ’…

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. Stealing from the best is a compliment, bestie. ๐Ÿ’–

โญ 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. (Yeah it's a redirect, go look there, iykyk.)

๐Ÿ‘‘ AUTHOR

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

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. Do it. For me. ๐Ÿฅบ

The "use warnings" pragma produces some lovely diagnostics. 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. Yeah. Don't do that one.

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? Bestie. We mentioned it. We're mentioning it again. ๐Ÿ˜ค

๐Ÿ“ BUGS

The behavior implied by the use warnings pragma is not mandatory. (Wild, I know.)

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>. Please include the config info, we're begging ๐Ÿ™

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. ๐Ÿ“–


And that's the whole page, bestie!! ๐ŸŽ‰ This was perl version v5.34.0, dated 2026-09-03, and it's literally titled PERL(1). Go write something iconic. ๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from