{
    "content": [
        {
            "type": "text",
            "text": "# lib (man)\n\n## NAME\n\nlib - manipulate @INC at compile time\n\n## SYNOPSIS\n\nuse lib LIST;\nno lib LIST;\n\n## DESCRIPTION\n\nThis is a small simple module which simplifies the manipulation of @INC at compile time.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (3 subsections)\n- **CAVEATS**\n- **NOTES**\n- **SEE ALSO**\n- **AUTHOR**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "lib",
        "section": "",
        "mode": "man",
        "summary": "lib - manipulate @INC at compile time",
        "synopsis": "use lib LIST;\nno lib LIST;",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 5,
                "subsections": [
                    {
                        "name": "Adding directories to @INC",
                        "lines": 24
                    },
                    {
                        "name": "Deleting directories from @INC",
                        "lines": 13
                    },
                    {
                        "name": "Restoring original @INC",
                        "lines": 5
                    }
                ]
            },
            {
                "name": "CAVEATS",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 8,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "lib - manipulate @INC at compile time\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use lib LIST;\n\nno lib LIST;\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This is a small simple module which simplifies the manipulation of @INC at compile time.\n\nIt is typically used to add extra directories to perl's search path so that later \"use\" or\n\"require\" statements will find modules which are not located on perl's default search path.\n",
                "subsections": [
                    {
                        "name": "Adding directories to @INC",
                        "content": "The parameters to \"use lib\" are added to the start of the perl search path. Saying\n\nuse lib LIST;\n\nis almost the same as saying\n\nBEGIN { unshift(@INC, LIST) }\n\nFor each directory in LIST (called $dir here) the lib module also checks to see if a\ndirectory called $dir/$archname/auto exists.  If so the $dir/$archname directory is assumed\nto be a corresponding architecture specific directory and is added to @INC in front of $dir.\nlib.pm also checks if directories called $dir/$version and $dir/$version/$archname exist and\nadds these directories to @INC.\n\nThe current value of $archname can be found with this command:\n\nperl -V:archname\n\nThe corresponding command to get the current value of $version is:\n\nperl -V:version\n\nTo avoid memory leaks, all trailing duplicate entries in @INC are removed.\n"
                    },
                    {
                        "name": "Deleting directories from @INC",
                        "content": "You should normally only add directories to @INC.  If you need to delete directories from\n@INC take care to only delete those which you added yourself or which you are certain are not\nneeded by other modules in your script.  Other modules may have added directories which they\nneed for correct operation.\n\nThe \"no lib\" statement deletes all instances of each named directory from @INC.\n\nFor each directory in LIST (called $dir here) the lib module also checks to see if a\ndirectory called $dir/$archname/auto exists.  If so the $dir/$archname directory is assumed\nto be a corresponding architecture specific directory and is also deleted from @INC. lib.pm\nalso checks if directories called $dir/$version and $dir/$version/$archname exist and deletes\nthese directories from @INC.\n"
                    },
                    {
                        "name": "Restoring original @INC",
                        "content": "When the lib module is first loaded it records the current value of @INC in an array\n@lib::ORIGINC. To restore @INC to that value you can say\n\n@INC = @lib::ORIGINC;\n"
                    }
                ]
            },
            "CAVEATS": {
                "content": "In order to keep lib.pm small and simple, it only works with Unix filepaths.  This doesn't\nmean it only works on Unix, but non-Unix users must first translate their file paths to Unix\nconventions.\n\n# VMS users wanting to put [.stuff.moo] into\n# their @INC would write\nuse lib 'stuff/moo';\n",
                "subsections": []
            },
            "NOTES": {
                "content": "In the future, this module will likely use File::Spec for determining paths, as it does now\nfor Mac OS (where Unix-style or Mac-style paths work, and Unix-style paths are converted\nproperly to Mac-style paths before being added to @INC).\n\nIf you try to add a file to @INC as follows:\n\nuse lib 'thisisafile.txt';\n\n\"lib\" will warn about this. The sole exceptions are files with the \".par\" extension which are\nintended to be used as libraries.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "FindBin - optional module which deals with paths relative to the source file.\n\nPAR - optional module which can treat \".par\" files as Perl libraries.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Tim Bunce, 2nd June 1995.\n\n\"lib\" is maintained by the perl5-porters. Please direct any questions to the canonical\nmailing list. Anything that is applicable to the CPAN release can be sent to its maintainer,\nthough.\n\nMaintainer: The Perl5-Porters <perl5-porters@perl.org>\n\nMaintainer of the CPAN release: Steffen Mueller <smueller@cpan.org>\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "This package has been part of the perl core since perl 5.001.  It has been released\nseparately to CPAN so older installations can benefit from bug fixes.\n\nThis package has the same copyright and license as the perl core.\n\n\n\nperl v5.34.0                                 2025-07-25                                   lib(3perl)",
                "subsections": []
            }
        }
    }
}