{
    "content": [
        {
            "type": "text",
            "text": "# perlcheat(1) (man)\n\n**Summary:** perlcheat - Perl 5 Cheat Sheet\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **DESCRIPTION** (3 lines) — 1 subsections\n  - The sheet (66 lines)\n- **ACKNOWLEDGEMENTS** (7 lines)\n- **AUTHOR** (2 lines)\n- **SEE ALSO** (9 lines)\n\n## Full Content\n\n### NAME\n\nperlcheat - Perl 5 Cheat Sheet\n\n### DESCRIPTION\n\nThis 'cheat sheet' is a handy reference, meant for beginning Perl programmers. Not everything\nis mentioned, but 195 features may already be overwhelming.\n\n#### The sheet\n\nCONTEXTS  SIGILS  ref        ARRAYS        HASHES\nvoid      $scalar SCALAR     @array        %hash\nscalar    @array  ARRAY      @array[0, 2]  @hash{'a', 'b'}\nlist      %hash   HASH       $array[0]     $hash{'a'}\n&sub    CODE\n*glob   GLOB       SCALAR VALUES\nFORMAT     number, string, ref, glob, undef\nREFERENCES\n\\      reference       $$foo[1]       aka $foo->[1]\n$@%&*  dereference     $$foo{bar}     aka $foo->{bar}\n[]     anon. arrayref  ${$$foo[1]}[2] aka $foo->[1]->[2]\n{}     anon. hashref   ${$$foo[1]}[2] aka $foo->[1][2]\n\\()    list of refs\nSYNTAX\nOPERATOR PRECEDENCE    foreach (LIST) { }     for (a;b;c) { }\n->                     while   (e) { }        until (e)   { }\n++ --                  if      (e) { } elsif (e) { } else { }\nunless  (e) { } elsif (e) { } else { }\n! ~ \\ u+ u-            given   (e) { when (e) {} default {} }\n=~ !~\n* / % x                 NUMBERS vs STRINGS  FALSE vs TRUE\n+ - .                   =          =        undef, \"\", 0, \"0\"\n<< >>                   +          .        anything else\nnamed uops              == !=      eq ne\n< > <= >= lt gt le ge   < > <= >=  lt gt le ge\n== != <=> eq ne cmp ~~  <=>        cmp\n&\n| ^             REGEX MODIFIERS       REGEX METACHARS\n&&              /i case insensitive   ^      string begin\n|| //           /m line based ^$      $      str end (bfr \\n)\n.. ...          /s . includes \\n      +      one or more\n?:              /x /xx ign. wh.space  *      zero or more\n= += last goto  /p preserve           ?      zero or one\n, =>            /a ASCII    /aa safe  {3,7}  repeat in range\nlist ops        /l locale   /d  dual  |      alternation\nnot             /u Unicode            []     character class\nand             /e evaluate /ee rpts  \\b     boundary\nor xor          /g global             \\z     string end\n/o compile pat once   ()     capture\nDEBUG                                 (?:p)  no capture\n-MO=Deparse     REGEX CHARCLASSES     (?#t)  comment\n-MO=Terse       .   [^\\n]             (?=p)  ZW pos ahead\n-D##            \\s  whitespace        (?!p)  ZW neg ahead\n-d:Trace        \\w  word chars        (?<=p) ZW pos behind \\K\n\\d  digits            (?<!p) ZW neg behind\nCONFIGURATION   \\pP named property    (?>p)  no backtrack\nperl -V:ivsize  \\h  horiz.wh.space    (?|p|p)branch reset\n\\R  linebreak         (?<n>p)named capture\n\\S \\W \\D \\H negate    \\g{n}  ref to named cap\n\\K     keep left part\nFUNCTION RETURN LISTS\nstat      localtime    caller         SPECIAL VARIABLES\n0 dev    0 second      0 package     $    default variable\n1 ino    1 minute      1 filename    $0    program name\n2 mode   2 hour        2 line        $/    input separator\n3 nlink  3 day         3 subroutine  $\\    output separator\n4 uid    4 month-1     4 hasargs     $|    autoflush\n5 gid    5 year-1900   5 wantarray   $!    sys/libcall error\n6 rdev   6 weekday     6 evaltext    $@    eval error\n7 size   7 yearday     7 isrequire  $$    process ID\n8 atime  8 isdst      8 hints       $.    line number\n9 mtime                9 bitmask     @ARGV command line args\n10 ctime               10 hinthash    @INC  include paths\n11 blksz               3..10 only     @    subroutine args\n12 blcks               with EXPR      %ENV  environment\n\n### ACKNOWLEDGEMENTS\n\nThe first version of this document appeared on Perl Monks, where several people had useful\nsuggestions. Thank you, Perl Monks.\n\nA special thanks to Damian Conway, who didn't only suggest important changes, but also took\nthe time to count the number of listed features and make a Raku version to show that Perl\nwill stay Perl.\n\n### AUTHOR\n\nJuerd Waalboer <#####@juerd.nl>, with the help of many Perl Monks.\n\n### SEE ALSO\n\n•   <https://perlmonks.org/?nodeid=216602> - the original PM post\n\n•   <https://perlmonks.org/?nodeid=238031> - Damian Conway's Raku version\n\n•   <https://juerd.nl/site.plp/perlcheat> - home of the Perl Cheat Sheet\n\n\n\nperl v5.34.0                                 2025-07-25                                 PERLCHEAT(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "perlcheat",
        "section": "1",
        "mode": "man",
        "summary": "perlcheat - Perl 5 Cheat Sheet",
        "synopsis": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": [
                    {
                        "name": "The sheet",
                        "lines": 66
                    }
                ]
            },
            {
                "name": "ACKNOWLEDGEMENTS",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 9,
                "subsections": []
            }
        ]
    }
}