{
    "content": [
        {
            "type": "text",
            "text": "# FindBin (man)\n\n## NAME\n\nFindBin - Locate directory of original perl script\n\n## SYNOPSIS\n\nuse FindBin;\nuse lib \"$FindBin::Bin/../lib\";\nor\nuse FindBin qw($Bin);\nuse lib \"$Bin/../lib\";\n\n## DESCRIPTION\n\nLocates the full path to the script bin directory to allow the use of paths relative to the\nbin directory.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **EXPORTABLE VARIABLES**\n- **KNOWN ISSUES**\n- **AUTHORS**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "FindBin",
        "section": "",
        "mode": "man",
        "summary": "FindBin - Locate directory of original perl script",
        "synopsis": "use FindBin;\nuse lib \"$FindBin::Bin/../lib\";\nor\nuse FindBin qw($Bin);\nuse lib \"$Bin/../lib\";",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "EXPORTABLE VARIABLES",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "KNOWN ISSUES",
                "lines": 16,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "FindBin - Locate directory of original perl script\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use FindBin;\nuse lib \"$FindBin::Bin/../lib\";\n\nor\n\nuse FindBin qw($Bin);\nuse lib \"$Bin/../lib\";\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Locates the full path to the script bin directory to allow the use of paths relative to the\nbin directory.\n\nThis allows a user to setup a directory tree for some software with directories \"<root>/bin\"\nand \"<root>/lib\", and then the above example will allow the use of modules in the lib\ndirectory without knowing where the software tree is installed.\n\nIf perl is invoked using the -e option or the perl script is read from \"STDIN\" then FindBin\nsets both $Bin and $RealBin to the current directory.\n",
                "subsections": []
            },
            "EXPORTABLE VARIABLES": {
                "content": "$Bin         - path to bin directory from where script was invoked\n$Script      - basename of script from which perl was invoked\n$RealBin     - $Bin with all links resolved\n$RealScript  - $Script with all links resolved\n",
                "subsections": []
            },
            "KNOWN ISSUES": {
                "content": "If there are two modules using \"FindBin\" from different directories under the same\ninterpreter, this won't work. Since \"FindBin\" uses a \"BEGIN\" block, it'll be executed only\nonce, and only the first caller will get it right. This is a problem under modperl and other\npersistent Perl environments, where you shouldn't use this module. Which also means that you\nshould avoid using \"FindBin\" in modules that you plan to put on CPAN. To make sure that\n\"FindBin\" will work is to call the \"again\" function:\n\nuse FindBin;\nFindBin::again(); # or FindBin->again;\n\nIn former versions of FindBin there was no \"again\" function. The workaround was to force the\n\"BEGIN\" block to be executed again:\n\ndelete $INC{'FindBin.pm'};\nrequire FindBin;\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "FindBin is supported as part of the core perl distribution. Please send bug reports to\n<perlbug@perl.org> using the perlbug program included with perl.\n\nGraham Barr <gbarr@pobox.com> Nick Ing-Simmons <nik@tiuk.ti.com>\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright (c) 1995 Graham Barr & Nick Ing-Simmons. All rights reserved.  This program is free\nsoftware; you can redistribute it and/or modify it under the same terms as Perl itself.\n\n\n\nperl v5.34.0                                 2025-07-25                               FindBin(3perl)",
                "subsections": []
            }
        }
    }
}