{
    "content": [
        {
            "type": "text",
            "text": "# autouse (man)\n\n## NAME\n\nautouse - postpone load of modules until a function is used\n\n## SYNOPSIS\n\nuse autouse 'Carp' => qw(carp croak);\ncarp \"this carp was predeclared and autoused \";\n\n## DESCRIPTION\n\nIf the module \"Module\" is already loaded, then the declaration\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **WARNING**\n- **AUTHOR**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "autouse",
        "section": "",
        "mode": "man",
        "summary": "autouse - postpone load of modules until a function is used",
        "synopsis": "use autouse 'Carp' => qw(carp croak);\ncarp \"this carp was predeclared and autoused \";",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "perl",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/perl/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 15,
                "subsections": []
            },
            {
                "name": "WARNING",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "autouse - postpone load of modules until a function is used\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use autouse 'Carp' => qw(carp croak);\ncarp \"this carp was predeclared and autoused \";\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "If the module \"Module\" is already loaded, then the declaration\n\nuse autouse 'Module' => qw(func1 func2($;$));\n\nis equivalent to\n\nuse Module qw(func1 func2);\n\nif \"Module\" defines func2() with prototype \"($;$)\", and func1() has no prototypes.  (At least\nif \"Module\" uses \"Exporter\"'s \"import\", otherwise it is a fatal error.)\n\nIf the module \"Module\" is not loaded yet, then the above declaration declares functions\nfunc1() and func2() in the current package.  When these functions are called, they load the\npackage \"Module\" if needed, and substitute themselves with the correct definitions.\n",
                "subsections": []
            },
            "WARNING": {
                "content": "Using \"autouse\" will move important steps of your program's execution from compile time to\nruntime.  This can\n\n•   Break the execution of your program if the module you \"autouse\"d has some initialization\nwhich it expects to be done early.\n\n•   hide bugs in your code since important checks (like correctness of prototypes) is moved\nfrom compile time to runtime.  In particular, if the prototype you specified on \"autouse\"\nline is wrong, you will not find it out until the corresponding function is executed.\nThis will be very unfortunate for functions which are not always called (note that for\nsuch functions \"autouse\"ing gives biggest win, for a workaround see below).\n\nTo alleviate the second problem (partially) it is advised to write your scripts like this:\n\nuse Module;\nuse autouse Module => qw(carp($) croak(&$));\ncarp \"this carp was predeclared and autoused \";\n\nThe first line ensures that the errors in your argument specification are found early.  When\nyou ship your application you should comment out the first line, since it makes the second\none useless.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Ilya Zakharevich (ilya@math.ohio-state.edu)\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "perl(1).\n\n\n\nperl v5.34.0                                 2025-07-25                               autouse(3perl)",
                "subsections": []
            }
        }
    }
}