PERL(1)
๐ธ NAME ๐ธ
perl โ The Perl 5 language interpreter ๐
Like, that's her. That's the whole thing. She runs Perl 5 and she's been doing it since before you were born, bestie.
โจ 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 ]...
Wanna know what every single one of those little letters does? Run this, no cap:
perldoc perlrun
๐ซถ GETTING HELP ๐ซถ
Okay so perldoc is your new bestie โ it hands you all the documentation that ships with Perl. And if you want more docs, tutorials, and actual community support from real humans, they're online at <https://www.perl.org/>. ๐โจ
New to Perl? Do not just rawdog the manual, I'm begging you ๐ญ. Start here:
perldoc perlintro
That's the general intro for beginners and it gives you the background you need so the rest of Perl's extensive documentation doesn't feel like a jumpscare. Once you're done there, run:
perldoc perldoc
and it'll show you all the other cute things perldoc can do for you. ๐
And for ease of access (because the Perl manual is, respectfully, enormous), it's been split up into several sections. Here's the map:
๐ฆ Overview
perlโ Perl overview (this section, hi, you're here ๐ )perlintroโ Perl introduction for beginnersperlrunโ Perl execution and optionsperltocโ Perl documentation table of contents
๐ Tutorials
perlreftutโ Perl references short introductionperldscโ Perl data structures introperllolโ Perl data structures: arrays of arraysperlrequickโ Perl regular expressions quick startperlretutโ Perl regular expressions tutorialperlootutโ Perl OO tutorial for beginnersperlperfโ Perl Performance and Optimization Techniquesperlstyleโ Perl style guideperlcheatโ Perl cheat sheetperltrapโ Perl traps for the unwaryperldebtutโ Perl debugging tutorialperlfaqโ Perl frequently asked questionsperlfaq1โ General Questions About Perlperlfaq2โ Obtaining and Learning about Perlperlfaq3โ Programming Toolsperlfaq4โ Data Manipulationperlfaq5โ Files and Formatsperlfaq6โ Regexesperlfaq7โ Perl Language Issuesperlfaq8โ System Interactionperlfaq9โ Networking
๐ Reference Manual
perlsynโ Perl syntax: declarations, statements, commentsperldataโ Perl data structuresperlopโ Perl expressions: operators, precedence, string literalsperlsubโ Perl subroutinesperlfuncโ Perl built-in functionsperlopentutโ Perl open() tutorialperlpacktutโ Perl pack() and unpack() tutorial
perlpodโ Perl plain old documentationperlpodspecโ Perl plain old documentation format specificationperldocstyleโ Perl style guide for core docsperlpodstyleโ Perl POD style guideperldiagโ Perl diagnostic messagesperldeprecationโ Perl deprecationsperllexwarnโ Perl warnings and their controlperldebugโ Perl debuggingperlvarโ Perl predefined variablesperlreโ Perl regular expressions, the rest of the storyperlrebackslashโ Perl regular expression backslash sequencesperlrecharclassโ Perl regular expression character classesperlrerefโ Perl regular expressions quick referenceperlrefโ Perl references, the rest of the storyperlformโ Perl formatsperlobjโ Perl objectsperltieโ Perl objects hidden behind simple variablesperldbmfilterโ Perl DBM filters
perlclassโ Perl class syntaxperlipcโ Perl interprocess communicationperlforkโ Perl fork() informationperlnumberโ Perl number semanticsperlthrtutโ Perl threads tutorialperlportโ Perl portability guideperllocaleโ Perl locale supportperluniintroโ Perl Unicode introductionperlunicodeโ Perl Unicode supportperlunicookโ Perl Unicode cookbookperlunifaqโ Perl Unicode FAQperlunipropsโ Index of Unicode properties in Perlperlunitutโ Perl Unicode tutorialperlebcdicโ Considerations for running Perl on EBCDIC platformsperlsecโ Perl securityperlsecpolicyโ Perl security report handling policyperlmodโ Perl modules: how they workperlmodlibโ Perl modules: how to write and useperlmodstyleโ Perl modules: how to write modules with styleperlmodinstallโ Perl modules: how to install from CPANperlnewmodโ Perl modules: preparing a new module for distributionperlpragmaโ Perl modules: writing a user pragmaperlutilโ utilities packaged with the Perl distributionperlfilterโ Perl source filtersperldtraceโ Perl's support for DTraceperlglossaryโ Perl Glossary
๐ Internals and C Language Interface
perlembedโ Perl ways to embed perl in your C or C++ applicationperldebgutsโ Perl debugging guts and tipsperlxstutโ Perl XS tutorialperlxsโ Perl XS application programming interfaceperlxstypemapโ Perl XS C/Perl type conversion toolsperlclibโ Interacting with standard C library functionsperlgutsโ Perl internal functions for those doing extensionsperlcallโ Perl calling conventions from Cperlmroapiโ Perl method resolution plugin interfaceperlreapiโ Perl regular expression plugin interfaceperlregutsโ Perl regular expression engine internalsperlclassgutsโ Internals of class syntaxperlapiโ Perl API listing (autogenerated)perlinternโ Perl internal functions (autogenerated)perliolโ C API for Perl's implementation of IO in Layersperlapioโ Perl internal IO abstraction interfaceperlhackโ Perl hackers guideperlsourceโ Guide to the Perl source treeperlinterpโ Overview of the Perl interpreter source and how it worksperlhacktutโ Walk through the creation of a simple C code patchperlhacktipsโ Tips for Perl core C code hackingperlpolicyโ Perl development policiesperlgovโ Perl Rules of Governanceperlgitโ Using git with the Perl repository
โจ History โจ
the receipts, the lore, the whole timeline bestie ๐
perlhistโ Perl history recordsperldeltaโ Perl changes since previous versionperl5400deltaโ Perl changes in version 5.40.0perl5382deltaโ Perl changes in version 5.38.2perl5381deltaโ Perl changes in version 5.38.1perl5380deltaโ Perl changes in version 5.38.0perl5363deltaโ Perl changes in version 5.36.3perl5362deltaโ Perl changes in version 5.36.2perl5361deltaโ Perl changes in version 5.36.1perl5360deltaโ Perl changes in version 5.36.0perl5343deltaโ Perl changes in version 5.34.3perl5342deltaโ Perl changes in version 5.34.2perl5341deltaโ Perl changes in version 5.34.1perl5340deltaโ Perl changes in version 5.34.0perl5321deltaโ Perl changes in version 5.32.1perl5320deltaโ Perl changes in version 5.32.0perl5303deltaโ Perl changes in version 5.30.3perl5302deltaโ Perl changes in version 5.30.2perl5301deltaโ Perl changes in version 5.30.1perl5300deltaโ Perl changes in version 5.30.0perl5283deltaโ Perl changes in version 5.28.3perl5282deltaโ Perl changes in version 5.28.2perl5281deltaโ Perl changes in version 5.28.1perl5280deltaโ Perl changes in version 5.28.0perl5263deltaโ Perl changes in version 5.26.3perl5262deltaโ Perl changes in version 5.26.2perl5261deltaโ Perl changes in version 5.26.1perl5260deltaโ Perl changes in version 5.26.0perl5244deltaโ Perl changes in version 5.24.4perl5243deltaโ Perl changes in version 5.24.3perl5242deltaโ Perl changes in version 5.24.2perl5241deltaโ Perl changes in version 5.24.1perl5240deltaโ Perl changes in version 5.24.0perl5224deltaโ Perl changes in version 5.22.4perl5223deltaโ Perl changes in version 5.22.3perl5222deltaโ Perl changes in version 5.22.2perl5221deltaโ Perl changes in version 5.22.1perl5220deltaโ Perl changes in version 5.22.0perl5203deltaโ Perl changes in version 5.20.3perl5202deltaโ Perl changes in version 5.20.2perl5201deltaโ Perl changes in version 5.20.1perl5200deltaโ Perl changes in version 5.20.0perl5184deltaโ Perl changes in version 5.18.4perl5182deltaโ Perl changes in version 5.18.2perl5181deltaโ Perl changes in version 5.18.1perl5180deltaโ Perl changes in version 5.18.0perl5163deltaโ Perl changes in version 5.16.3perl5162deltaโ Perl changes in version 5.16.2perl5161deltaโ Perl changes in version 5.16.1perl5160deltaโ Perl changes in version 5.16.0perl5144deltaโ Perl changes in version 5.14.4perl5143deltaโ Perl changes in version 5.14.3perl5142deltaโ Perl changes in version 5.14.2perl5141deltaโ Perl changes in version 5.14.1perl5140deltaโ Perl changes in version 5.14.0perl5125deltaโ Perl changes in version 5.12.5perl5124deltaโ Perl changes in version 5.12.4perl5123deltaโ Perl changes in version 5.12.3perl5122deltaโ Perl changes in version 5.12.2perl5121deltaโ Perl changes in version 5.12.1perl5120deltaโ Perl changes in version 5.12.0perl5101deltaโ Perl changes in version 5.10.1perl5100deltaโ Perl changes in version 5.10.0perl589deltaโ Perl changes in version 5.8.9perl588deltaโ Perl changes in version 5.8.8perl587deltaโ Perl changes in version 5.8.7perl586deltaโ Perl changes in version 5.8.6perl585deltaโ Perl changes in version 5.8.5perl584deltaโ Perl changes in version 5.8.4perl583deltaโ Perl changes in version 5.8.3perl582deltaโ Perl changes in version 5.8.2perl581deltaโ Perl changes in version 5.8.1perl58deltaโ Perl changes in version 5.8.0perl561deltaโ Perl changes in version 5.6.1perl56deltaโ Perl changes in version 5.6perl5005deltaโ Perl changes in version 5.005perl5004deltaโ Perl changes in version 5.004
๐ Miscellaneous ๐
the little grab-bag of goodies, no cap ๐ซถ
perlbookโ Perl book informationperlcommunityโ Perl community informationperldocโ Look up Perl documentation in Pod formatperlexperimentโ A listing of experimental features in Perlperlartisticโ Perl Artistic Licenseperlgplโ GNU General Public License
๐ธ Language-Specific ๐ธ
Perl said "i speak your language too bestie" ๐
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 gets its own lil love letter, fr fr ๐
perlaixโ Perl notes for AIXperlamigaโ Perl notes for AmigaOSperlandroidโ Perl notes for Androidperlbs2000โ Perl notes for POSIX-BC BS2000perlcygwinโ Perl notes for Cygwinperlfreebsdโ Perl notes for FreeBSDperlhaikuโ Perl notes for Haikuperlhpuxโ Perl notes for HP-UXperlhurdโ Perl notes for Hurdperlirixโ Perl notes for Irixperllinuxโ Perl notes for Linuxperlmacosxโ Perl notes for Mac OS Xperlopenbsdโ Perl notes for OpenBSDperlos2โ Perl notes for OS/2perlos390โ Perl notes for OS/390perlos400โ Perl notes for OS/400perlplan9โ Perl notes for Plan 9perlqnxโ Perl notes for QNXperlriscosโ Perl notes for RISC OSperlsolarisโ Perl notes for Solarisperlsynologyโ Perl notes for Synologyperltru64โ Perl notes for Tru64perlvmsโ Perl notes for VMSperlvosโ Perl notes for Stratus VOSperlwin32โ Perl notes for Windows
๐ Stubs for Deleted Documents ๐
rip to these pages, they're ghosts now, but their names live on ๐ป
perlbootperlbotperlrepositoryperltodoperltoocperltoot
okay Debian besties, special note for you: you gotta install the perl-doc package, because that's the one holding the majority of the standard Perl documentation and the perldoc program itself. ๐
and there's SO much more docs out there โ extensive additional documentation for Perl modules, both the ones that ship with Perl and third-party modules that are packaged or locally installed. โจ
you should be able to view all of Perl's documentation with your man(1) program or perldoc(1). ๐ซถ
heads up tho: some documentation is not available as man pages. so if man can't find a cross-reference, try it with perldoc instead. perldoc can also take you straight to documentation for functions (with the -f switch). see perldoc --help (or perldoc perldoc or man perldoc) for the other helpful options perldoc has to offer. ๐
and like, in general? if something strange has gone wrong with your program and you're not sure where you should even look for help, try making your code comply with use strict and use warnings. these will often point out exactly where the trouble is. it's giving "the compiler is your therapist" ๐ญ
โจ 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 ๐
<https://www.perl.org/>โ the Perl homepage<https://www.perl.com/>โ Perl articles<https://www.cpan.org/>โ the Comprehensive Perl Archive<https://www.pm.org/>โ the Perl Mongers
๐ฉบ DIAGNOSTICS ๐ฉบ
Okay bestie, listen โ the use strict pragma is literally the friend who makes sure every single variable is properly declared, and it also blocks all those other sneaky misuses of legacy Perl features. And guess what? It's enabled by default inside the scope of use v5.12 (or higher). So if you're on a modern version you already have it. Iconic behavior.
The use warnings pragma gives you the most lovely diagnostics โ genuinely, they're a gift. It's enabled by default when you say use v5.35 (or higher). You could also use the -w flag, but ngl its use is normally discouraged, because it gets applied to all executed Perl code, including code that is not under your control. ๐ Not the vibe.
See perldiag for explanations of all of Perl's diagnostics โ that's your glossary, your study guide, your bestie. And the use diagnostics pragma will automatically turn Perl's normally terse warnings and errors into those longer, chattier forms. โจ
Compilation errors will tell you the line number of the error, along with an indication of the next token or token type that was to be examined. (Sneaky detail: 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 for the whole saga.
And did we mention that you should definitely consider using the use warnings pragma? Because you should. Consider it. Considered? Good. ๐ซถ
๐ BUGS ๐
The behavior implied by the use warnings pragma is not mandatory. Yeah. We 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(). It's giving "not my fault, blame the hardware." ๐
If your stdio requires a seek or eof between reads and writes on a particular stream, then so does Perl. (This doesn't apply to sysread() and syswrite(), those two are exempt, slay.)
While none of the built-in data types have any arbitrary size limits (apart from memory size, obviously, memory is memory), there are still a few arbitrary limits lurking:
- a given variable name may not be longer than 251 characters โ so maybe chill on the descriptive names, queen
- line numbers displayed by diagnostics are internally stored as short integers, so they're limited to a maximum of 65535 (higher numbers usually being affected by wraparound โ yes, wraparound, the chaos)
You may submit your bug reports to:
<https://github.com/Perl/perl5/issues>
Be sure to include full configuration information as output by the myconfig program in the perl source tree, or by perl -V. Full receipts, always. ๐งพ
And fun fact: 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. ๐ (It's a lot. It's so many. Good luck.)
The three principal virtues of a programmer are Laziness, Impatience, and Hubris. See the Camel Book for why โ that's a whole other rabbit hole, iykyk. ๐ช๐
And that's the whole page, bestie!! You made it to the very end, which is honestly main character energy. This was perl version v5.40.1, dated 2025-09-11 โ go forth, write some wildly eclectic code, and remember: always use warnings. ๐โจ๐๐ฆ๐
๐ฆ where this page comes from
- ubuntu questing: perl-base 5.40.1-6build1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms