{
    "content": [
        {
            "type": "text",
            "text": "# perl (perldoc)\n\n## TLDR\n\n> The Perl 5 language interpreter.\n\n- Print lines from `stdin` [m]atching `regex1` and case [i]nsensitive `regex2`:\n  `perl -n -e 'print if m/regex1/ and m/regex2/i'`\n- Say ([-E]) first match group, using a `regex`, ignoring space ([x]) in `regex`:\n  `perl -n -E 'say $1 if m/{{before}} ( {{group_regex}} ) {{after}}/x'`\n- [i]n-place, with backup, [s]ubstitute all occurrence ([g]) of `regex` with a replacement:\n  `perl -i'.bak' -p -e 's/regex/{{replacement}}/g' {{path/to/files}}`\n\n*Source: tldr-pages*\n\n---\n\n**Summary:** perl - The Perl 5 language interpreter\n\n**Synopsis:** perl [ -sTtuUWX ] [ -hv ] [ -V[:*configvar*] ]\n[ -cw ] [ -d[t][:*debugger*] ] [ -D[*number/list*] ]\n[ -pna ] [ -F*pattern* ] [ -l[*octal*] ] [ -0[*octal/hexadecimal*] ]\n[ -I*dir* ] [ -m[-]*module* ] [ -M[-]*'module...'* ] [ -f ] [ -C [*number/list*] ] [ -S ]\n[ -x[*dir*] ] [ -i[*extension*] ]\n[ [-e|-E] *'command'* ] [ -- ] [ *programfile* ] [ *argument* ]...\nFor more information on these options, you can run \"perldoc perlrun\".\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (9 lines)\n- **GETTING HELP** (9 lines) — 9 subsections\n  - Overview (5 lines)\n  - Tutorials (28 lines)\n  - Reference Manual (60 lines)\n  - Internals and C Language Interface (26 lines)\n  - History (66 lines)\n  - Miscellaneous (10 lines)\n  - Language-Specific (5 lines)\n  - Platform-Specific (29 lines)\n  - Stubs for Deleted Documents (24 lines)\n- **DESCRIPTION** (22 lines)\n- **AVAILABILITY** (3 lines)\n- **ENVIRONMENT** (2 lines)\n- **AUTHOR** (6 lines)\n- **FILES** (5 lines)\n- **SEE ALSO** (5 lines)\n- **DIAGNOSTICS** (19 lines)\n- **BUGS** (3 lines) — 1 subsections\n  - atof (15 lines)\n- **NOTES** (6 lines)\n\n## Full Content\n\n### NAME\n\nperl - The Perl 5 language interpreter\n\n### SYNOPSIS\n\nperl [ -sTtuUWX ] [ -hv ] [ -V[:*configvar*] ]\n[ -cw ] [ -d[t][:*debugger*] ] [ -D[*number/list*] ]\n[ -pna ] [ -F*pattern* ] [ -l[*octal*] ] [ -0[*octal/hexadecimal*] ]\n[ -I*dir* ] [ -m[-]*module* ] [ -M[-]*'module...'* ] [ -f ] [ -C [*number/list*] ] [ -S ]\n[ -x[*dir*] ] [ -i[*extension*] ]\n[ [-e|-E] *'command'* ] [ -- ] [ *programfile* ] [ *argument* ]...\n\nFor more information on these options, you can run \"perldoc perlrun\".\n\n### GETTING HELP\n\nThe perldoc program gives you access to all the documentation that comes with Perl. You can get\nmore documentation, tutorials and community support online at <https://www.perl.org/>.\n\nIf you're new to Perl, you should start by running \"perldoc perlintro\", which is a general intro\nfor beginners and provides some background to help you navigate the rest of Perl's extensive\ndocumentation. Run \"perldoc perldoc\" to learn more things you can do with perldoc.\n\nFor ease of access, the Perl manual has been split up into several sections.\n\n#### Overview\n\nperl                Perl overview (this section)\nperlintro           Perl introduction for beginners\nperlrun             Perl execution and options\nperltoc             Perl documentation table of contents\n\n#### Tutorials\n\nperlreftut          Perl references short introduction\nperldsc             Perl data structures intro\nperllol             Perl data structures: arrays of arrays\n\nperlrequick         Perl regular expressions quick start\nperlretut           Perl regular expressions tutorial\n\nperlootut           Perl OO tutorial for beginners\n\nperlperf            Perl Performance and Optimization Techniques\n\nperlstyle           Perl style guide\n\nperlcheat           Perl cheat sheet\nperltrap            Perl traps for the unwary\nperldebtut          Perl debugging tutorial\n\nperlfaq             Perl frequently asked questions\nperlfaq1          General Questions About Perl\nperlfaq2          Obtaining and Learning about Perl\nperlfaq3          Programming Tools\nperlfaq4          Data Manipulation\nperlfaq5          Files and Formats\nperlfaq6          Regexes\nperlfaq7          Perl Language Issues\nperlfaq8          System Interaction\nperlfaq9          Networking\n\n#### Reference Manual\n\nperlsyn             Perl syntax\nperldata            Perl data structures\nperlop              Perl operators and precedence\nperlsub             Perl subroutines\nperlfunc            Perl built-in functions\nperlopentut       Perl open() tutorial\nperlpacktut       Perl pack() and unpack() tutorial\nperlpod             Perl plain old documentation\nperlpodspec         Perl plain old documentation format specification\nperldocstyle        Perl style guide for core docs\nperlpodstyle        Perl POD style guide\nperldiag            Perl diagnostic messages\nperldeprecation     Perl deprecations\nperllexwarn         Perl warnings and their control\nperldebug           Perl debugging\nperlvar             Perl predefined variables\nperlre              Perl regular expressions, the rest of the story\nperlrebackslash     Perl regular expression backslash sequences\nperlrecharclass     Perl regular expression character classes\nperlreref           Perl regular expressions quick reference\nperlref             Perl references, the rest of the story\nperlform            Perl formats\nperlobj             Perl objects\nperltie             Perl objects hidden behind simple variables\nperldbmfilter     Perl DBM filters\n\nperlipc             Perl interprocess communication\nperlfork            Perl fork() information\nperlnumber          Perl number semantics\n\nperlthrtut          Perl threads tutorial\n\nperlport            Perl portability guide\nperllocale          Perl locale support\nperluniintro        Perl Unicode introduction\nperlunicode         Perl Unicode support\nperlunicook         Perl Unicode cookbook\nperlunifaq          Perl Unicode FAQ\nperluniprops        Index of Unicode properties in Perl\nperlunitut          Perl Unicode tutorial\nperlebcdic          Considerations for running Perl on EBCDIC platforms\n\nperlsec             Perl security\nperlsecpolicy       Perl security report handling policy\n\nperlmod             Perl modules: how they work\nperlmodlib          Perl modules: how to write and use\nperlmodstyle        Perl modules: how to write modules with style\nperlmodinstall      Perl modules: how to install from CPAN\nperlnewmod          Perl modules: preparing a new module for distribution\nperlpragma          Perl modules: writing a user pragma\n\nperlutil            utilities packaged with the Perl distribution\n\nperlfilter          Perl source filters\n\nperldtrace          Perl's support for DTrace\n\nperlglossary        Perl Glossary\n\n#### Internals and C Language Interface\n\nperlembed           Perl ways to embed perl in your C or C++ application\nperldebguts         Perl debugging guts and tips\nperlxstut           Perl XS tutorial\nperlxs              Perl XS application programming interface\nperlxstypemap       Perl XS C/Perl type conversion tools\nperlclib            Internal replacements for standard C library functions\nperlguts            Perl internal functions for those doing extensions\nperlcall            Perl calling conventions from C\nperlmroapi          Perl method resolution plugin interface\nperlreapi           Perl regular expression plugin interface\nperlreguts          Perl regular expression engine internals\n\nperlapi             Perl API listing (autogenerated)\nperlintern          Perl internal functions (autogenerated)\nperliol             C API for Perl's implementation of IO in Layers\nperlapio            Perl internal IO abstraction interface\n\nperlhack            Perl hackers guide\nperlsource          Guide to the Perl source tree\nperlinterp          Overview of the Perl interpreter source and how it works\nperlhacktut         Walk through the creation of a simple C code patch\nperlhacktips        Tips for Perl core C code hacking\nperlpolicy          Perl development policies\nperlgov             Perl Rules of Governance\nperlgit             Using git with the Perl repository\n\n#### History\n\nperlhist            Perl history records\nperldelta           Perl changes since previous version\nperl5321delta       Perl changes in version 5.32.1\nperl5320delta       Perl changes in version 5.32.0\nperl5303delta       Perl changes in version 5.30.3\nperl5302delta       Perl changes in version 5.30.2\nperl5301delta       Perl changes in version 5.30.1\nperl5300delta       Perl changes in version 5.30.0\nperl5283delta       Perl changes in version 5.28.3\nperl5282delta       Perl changes in version 5.28.2\nperl5281delta       Perl changes in version 5.28.1\nperl5280delta       Perl changes in version 5.28.0\nperl5263delta       Perl changes in version 5.26.3\nperl5262delta       Perl changes in version 5.26.2\nperl5261delta       Perl changes in version 5.26.1\nperl5260delta       Perl changes in version 5.26.0\nperl5244delta       Perl changes in version 5.24.4\nperl5243delta       Perl changes in version 5.24.3\nperl5242delta       Perl changes in version 5.24.2\nperl5241delta       Perl changes in version 5.24.1\nperl5240delta       Perl changes in version 5.24.0\nperl5224delta       Perl changes in version 5.22.4\nperl5223delta       Perl changes in version 5.22.3\nperl5222delta       Perl changes in version 5.22.2\nperl5221delta       Perl changes in version 5.22.1\nperl5220delta       Perl changes in version 5.22.0\nperl5203delta       Perl changes in version 5.20.3\nperl5202delta       Perl changes in version 5.20.2\nperl5201delta       Perl changes in version 5.20.1\nperl5200delta       Perl changes in version 5.20.0\nperl5184delta       Perl changes in version 5.18.4\nperl5182delta       Perl changes in version 5.18.2\nperl5181delta       Perl changes in version 5.18.1\nperl5180delta       Perl changes in version 5.18.0\nperl5163delta       Perl changes in version 5.16.3\nperl5162delta       Perl changes in version 5.16.2\nperl5161delta       Perl changes in version 5.16.1\nperl5160delta       Perl changes in version 5.16.0\nperl5144delta       Perl changes in version 5.14.4\nperl5143delta       Perl changes in version 5.14.3\nperl5142delta       Perl changes in version 5.14.2\nperl5141delta       Perl changes in version 5.14.1\nperl5140delta       Perl changes in version 5.14.0\nperl5125delta       Perl changes in version 5.12.5\nperl5124delta       Perl changes in version 5.12.4\nperl5123delta       Perl changes in version 5.12.3\nperl5122delta       Perl changes in version 5.12.2\nperl5121delta       Perl changes in version 5.12.1\nperl5120delta       Perl changes in version 5.12.0\nperl5101delta       Perl changes in version 5.10.1\nperl5100delta       Perl changes in version 5.10.0\nperl589delta        Perl changes in version 5.8.9\nperl588delta        Perl changes in version 5.8.8\nperl587delta        Perl changes in version 5.8.7\nperl586delta        Perl changes in version 5.8.6\nperl585delta        Perl changes in version 5.8.5\nperl584delta        Perl changes in version 5.8.4\nperl583delta        Perl changes in version 5.8.3\nperl582delta        Perl changes in version 5.8.2\nperl581delta        Perl changes in version 5.8.1\nperl58delta         Perl changes in version 5.8.0\nperl561delta        Perl changes in version 5.6.1\nperl56delta         Perl changes in version 5.6\nperl5005delta       Perl changes in version 5.005\nperl5004delta       Perl changes in version 5.004\n\n#### Miscellaneous\n\nperlbook            Perl book information\nperlcommunity       Perl community information\n\nperldoc             Look up Perl documentation in Pod format\n\nperlexperiment      A listing of experimental features in Perl\n\nperlartistic        Perl Artistic License\nperlgpl             GNU General Public License\n\n#### Language-Specific\n\nperlcn              Perl for Simplified Chinese (in UTF-8)\nperljp              Perl for Japanese (in EUC-JP)\nperlko              Perl for Korean (in EUC-KR)\nperltw              Perl for Traditional Chinese (in Big5)\n\n#### Platform-Specific\n\nperlaix             Perl notes for AIX\nperlamiga           Perl notes for AmigaOS\nperlandroid         Perl notes for Android\nperlbs2000          Perl notes for POSIX-BC BS2000\nperlcygwin          Perl notes for Cygwin\nperldos             Perl notes for DOS\nperlfreebsd         Perl notes for FreeBSD\nperlhaiku           Perl notes for Haiku\nperlhpux            Perl notes for HP-UX\nperlhurd            Perl notes for Hurd\nperlirix            Perl notes for Irix\nperllinux           Perl notes for Linux\nperlmacos           Perl notes for Mac OS (Classic)\nperlmacosx          Perl notes for Mac OS X\nperlnetware         Perl notes for NetWare\nperlopenbsd         Perl notes for OpenBSD\nperlos2             Perl notes for OS/2\nperlos390           Perl notes for OS/390\nperlos400           Perl notes for OS/400\nperlplan9           Perl notes for Plan 9\nperlqnx             Perl notes for QNX\nperlriscos          Perl notes for RISC OS\nperlsolaris         Perl notes for Solaris\nperlsynology        Perl notes for Synology\nperltru64           Perl notes for Tru64\nperlvms             Perl notes for VMS\nperlvos             Perl notes for Stratus VOS\nperlwin32           Perl notes for Windows\n\n#### Stubs for Deleted Documents\n\nperlboot\nperlbot\nperlrepository\nperltodo\nperltooc\nperltoot\n\nOn Debian systems, you need to install the perl-doc package which contains the majority of the\nstandard Perl documentation and the perldoc program.\n\nExtensive additional documentation for Perl modules is available, both those distributed with\nPerl and third-party modules which are packaged or locally installed.\n\nYou should be able to view Perl's documentation with your man(1) program or perldoc(1).\n\nSome documentation is not available as man pages, so if a cross-reference is not found by man,\ntry it with perldoc. Perldoc can also take you directly to documentation for functions (with the\n-f switch). See \"perldoc --help\" (or \"perldoc perldoc\" or \"man perldoc\") for other helpful\noptions perldoc has to offer.\n\nIn general, if something strange has gone wrong with your program and you're not sure where you\nshould look for help, try making your code comply with use strict and use warnings. These will\noften point out exactly where the trouble is.\n\n### DESCRIPTION\n\nPerl officially stands for Practical Extraction and Report Language, except when it doesn't.\n\nPerl was originally a language optimized for scanning arbitrary text files, extracting\ninformation from those text files, and printing reports based on that information. It quickly\nbecame a good language for many system management tasks. Over the years, Perl has grown into a\ngeneral-purpose programming language. It's widely used for everything from quick \"one-liners\" to\nfull-scale application development.\n\nThe language is intended to be practical (easy to use, efficient, complete) rather than\nbeautiful (tiny, elegant, minimal). It combines (in the author's opinion, anyway) some of the\nbest features of sed, awk, and sh, making it familiar and easy to use for Unix users to whip up\nquick solutions to annoying problems. Its general-purpose programming facilities support\nprocedural, functional, and object-oriented programming paradigms, making Perl a comfortable\nlanguage for the long haul on major projects, whatever your bent.\n\nPerl's roots in text processing haven't been forgotten over the years. It still boasts some of\nthe most powerful regular expressions to be found anywhere, and its support for Unicode text is\nworld-class. It handles all kinds of structured text, too, through an extensive collection of\nextensions. Those libraries, collected in the CPAN, provide ready-made solutions to an\nastounding array of problems. When they haven't set the standard themselves, they steal from the\nbest -- just like Perl itself.\n\n### AVAILABILITY\n\nPerl is available for most operating systems, including virtually all Unix-like platforms. See\n\"Supported Platforms\" in perlport for a listing.\n\n### ENVIRONMENT\n\nSee \"ENVIRONMENT\" in perlrun.\n\n### AUTHOR\n\nLarry Wall <larry@wall.org>, with the help of oodles of other folks.\n\nIf your Perl success stories and testimonials may be of help to others who wish to advocate the\nuse of Perl in their applications, or if you wish to simply express your gratitude to Larry and\nthe Perl developers, please write to perl-thanks@perl.org .\n\n### FILES\n\n\"@INC\"                 locations of perl libraries\n\n\"@INC\" above is a reference to the built-in variable of the same name; see perlvar for more\ninformation.\n\n### SEE ALSO\n\nhttps://www.perl.org/       the Perl homepage\nhttps://www.perl.com/       Perl articles\nhttps://www.cpan.org/       the Comprehensive Perl Archive\nhttps://www.pm.org/         the Perl Mongers\n\n### DIAGNOSTICS\n\nUsing the \"use strict\" pragma ensures that all variables are properly declared and prevents\nother misuses of legacy Perl features.\n\nThe \"use warnings\" pragma produces some lovely diagnostics. One can also use the -w flag, but\nits use is normally discouraged, because it gets applied to all executed Perl code, including\nthat not under your control.\n\nSee perldiag for explanations of all Perl's diagnostics. The \"use diagnostics\" pragma\nautomatically turns Perl's normally terse warnings and errors into these longer forms.\n\nCompilation errors will tell you the line number of the error, with an indication of the next\ntoken or token type that was to be examined. (In a script passed to Perl via -e switches, each\n-e is counted as one line.)\n\nSetuid scripts have additional constraints that can produce error messages such as \"Insecure\ndependency\". See perlsec.\n\nDid we mention that you should definitely consider using the use warnings pragma?\n\n### BUGS\n\nThe behavior implied by the use warnings pragma is not mandatory.\n\nPerl is at the mercy of your machine's definitions of various operations such as type casting,\n\n#### atof\n\nIf your stdio requires a seek or eof between reads and writes on a particular stream, so does\nPerl. (This doesn't apply to sysread() and syswrite().)\n\nWhile none of the built-in data types have any arbitrary size limits (apart from memory size),\nthere are still a few arbitrary limits: a given variable name may not be longer than 251\ncharacters. Line numbers displayed by diagnostics are internally stored as short integers, so\nthey are limited to a maximum of 65535 (higher numbers usually being affected by wraparound).\n\nYou may submit your bug reports (be sure to include full configuration information as output by\nthe myconfig program in the perl source tree, or by \"perl -V\") to\n<https://github.com/Perl/perl5/issues>.\n\nPerl actually stands for Pathologically Eclectic Rubbish Lister, but don't tell anyone I said\nthat.\n\n### NOTES\n\nThe Perl motto is \"There's more than one way to do it.\" Divining how many more is left as an\nexercise to the reader.\n\nThe three principal virtues of a programmer are Laziness, Impatience, and Hubris. See the Camel\nBook for why.\n\n"
        }
    ],
    "structuredContent": {
        "command": "perl",
        "section": "",
        "mode": "perldoc",
        "summary": "perl - The Perl 5 language interpreter",
        "synopsis": "perl [ -sTtuUWX ] [ -hv ] [ -V[:*configvar*] ]\n[ -cw ] [ -d[t][:*debugger*] ] [ -D[*number/list*] ]\n[ -pna ] [ -F*pattern* ] [ -l[*octal*] ] [ -0[*octal/hexadecimal*] ]\n[ -I*dir* ] [ -m[-]*module* ] [ -M[-]*'module...'* ] [ -f ] [ -C [*number/list*] ] [ -S ]\n[ -x[*dir*] ] [ -i[*extension*] ]\n[ [-e|-E] *'command'* ] [ -- ] [ *programfile* ] [ *argument* ]...\nFor more information on these options, you can run \"perldoc perlrun\".",
        "tldr_summary": "The Perl 5 language interpreter.",
        "tldr_examples": [
            {
                "description": "Print lines from `stdin` [m]atching `regex1` and case [i]nsensitive `regex2`",
                "command": "perl -n -e 'print if m/regex1/ and m/regex2/i'"
            },
            {
                "description": "Say ([-E]) first match group, using a `regex`, ignoring space ([x]) in `regex`",
                "command": "perl -n -E 'say $1 if m/{{before}} ( {{group_regex}} ) {{after}}/x'"
            },
            {
                "description": "[i]n-place, with backup, [s]ubstitute all occurrence ([g]) of `regex` with a replacement",
                "command": "perl -i'.bak' -p -e 's/regex/{{replacement}}/g' {{path/to/files}}"
            }
        ],
        "tldr_source": "official",
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "GETTING HELP",
                "lines": 9,
                "subsections": [
                    {
                        "name": "Overview",
                        "lines": 5
                    },
                    {
                        "name": "Tutorials",
                        "lines": 28
                    },
                    {
                        "name": "Reference Manual",
                        "lines": 60
                    },
                    {
                        "name": "Internals and C Language Interface",
                        "lines": 26
                    },
                    {
                        "name": "History",
                        "lines": 66
                    },
                    {
                        "name": "Miscellaneous",
                        "lines": 10
                    },
                    {
                        "name": "Language-Specific",
                        "lines": 5
                    },
                    {
                        "name": "Platform-Specific",
                        "lines": 29
                    },
                    {
                        "name": "Stubs for Deleted Documents",
                        "lines": 24
                    }
                ]
            },
            {
                "name": "DESCRIPTION",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "AVAILABILITY",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "ENVIRONMENT",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "DIAGNOSTICS",
                "lines": 19,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 3,
                "subsections": [
                    {
                        "name": "atof",
                        "lines": 15
                    }
                ]
            },
            {
                "name": "NOTES",
                "lines": 6,
                "subsections": []
            }
        ]
    }
}