{
    "content": [
        {
            "type": "text",
            "text": "# strict (man)\n\n## NAME\n\nstrict - Perl pragma to restrict unsafe constructs\n\n## SYNOPSIS\n\nuse strict;\nuse strict \"vars\";\nuse strict \"refs\";\nuse strict \"subs\";\nuse strict;\nno strict \"vars\";\n\n## DESCRIPTION\n\nThe \"strict\" pragma disables certain Perl expressions that could behave unexpectedly or are\ndifficult to debug, turning them into errors. The effect of this pragma is limited to the\ncurrent file or scope block.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **HISTORY**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "strict",
        "section": "",
        "mode": "man",
        "summary": "strict - Perl pragma to restrict unsafe constructs",
        "synopsis": "use strict;\nuse strict \"vars\";\nuse strict \"refs\";\nuse strict \"subs\";\nuse strict;\nno strict \"vars\";",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 61,
                "subsections": []
            },
            {
                "name": "HISTORY",
                "lines": 15,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "strict - Perl pragma to restrict unsafe constructs\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use strict;\n\nuse strict \"vars\";\nuse strict \"refs\";\nuse strict \"subs\";\n\nuse strict;\nno strict \"vars\";\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The \"strict\" pragma disables certain Perl expressions that could behave unexpectedly or are\ndifficult to debug, turning them into errors. The effect of this pragma is limited to the\ncurrent file or scope block.\n\nIf no import list is supplied, all possible restrictions are assumed.  (This is the safest\nmode to operate in, but is sometimes too strict for casual programming.)  Currently, there\nare three possible things to be strict about:  \"subs\", \"vars\", and \"refs\".\n\n\"strict refs\"\nThis generates a runtime error if you use symbolic references (see perlref).\n\nuse strict 'refs';\n$ref = \\$foo;\nprint $$ref;        # ok\n$ref = \"foo\";\nprint $$ref;        # runtime error; normally ok\n$file = \"STDOUT\";\nprint $file \"Hi!\";  # error; note: no comma after $file\n\nThere is one exception to this rule:\n\n$bar = \\&{'foo'};\n&$bar;\n\nis allowed so that \"goto &$AUTOLOAD\" would not break under stricture.\n\n\"strict vars\"\nThis generates a compile-time error if you access a variable that was neither\nexplicitly declared (using any of \"my\", \"our\", \"state\", or \"use vars\") nor fully\nqualified.  (Because this is to avoid variable suicide problems and subtle dynamic\nscoping issues, a merely \"local\" variable isn't good enough.)  See \"my\" in perlfunc,\n\"our\" in perlfunc, \"state\" in perlfunc, \"local\" in perlfunc, and vars.\n\nuse strict 'vars';\n$X::foo = 1;         # ok, fully qualified\nmy $foo = 10;        # ok, my() var\nlocal $baz = 9;      # blows up, $baz not declared before\n\npackage Cinna;\nour $bar;                   # Declares $bar in current package\n$bar = 'HgS';               # ok, global declared via pragma\n\nThe local() generated a compile-time error because you just touched a global name\nwithout fully qualifying it.\n\nBecause of their special use by sort(), the variables $a and $b are exempted from this\ncheck.\n\n\"strict subs\"\nThis disables the poetry optimization, generating a compile-time error if you try to\nuse a bareword identifier that's not a subroutine, unless it is a simple identifier (no\ncolons) and that it appears in curly braces, on the left hand side of the \"=>\" symbol,\nor has the unary minus operator applied to it.\n\nuse strict 'subs';\n$SIG{PIPE} = Plumber;   # blows up\n$SIG{PIPE} = \"Plumber\"; # fine: quoted string is always ok\n$SIG{PIPE} = \\&Plumber; # preferred form\n\nSee \"Pragmatic Modules\" in perlmodlib.\n",
                "subsections": []
            },
            "HISTORY": {
                "content": "\"strict 'subs'\", with Perl 5.6.1, erroneously permitted to use an unquoted compound\nidentifier (e.g. \"Foo::Bar\") as a hash key (before \"=>\" or inside curlies), but without\nforcing it always to a literal string.\n\nStarting with Perl 5.8.1 strict is strict about its restrictions: if unknown restrictions are\nused, the strict pragma will abort with\n\nUnknown 'strict' tag(s) '...'\n\nAs of version 1.04 (Perl 5.10), strict verifies that it is used as \"strict\" to avoid the\ndreaded Strict trap on case insensitive file systems.\n\n\n\nperl v5.34.0                                 2025-07-25                                strict(3perl)",
                "subsections": []
            }
        }
    }
}