{
    "content": [
        {
            "type": "text",
            "text": "# Sub::Identify (perldoc)\n\n## NAME\n\nSub::Identify - Retrieve names of code references\n\n## SYNOPSIS\n\nuse Sub::Identify ':all';\nmy $subname = subname( $somecoderef );\nmy $packagename = stashname( $somecoderef );\n# or, to get all at once...\nmy $fullyqualifiedname = subfullname( $somecoderef );\ndefined $subname\nand say \"this coderef points to sub $subname in package $packagename\";\nmy ($file, $line) = getcodelocation( $somecoderef );\n$file\nand say \"this coderef is defined at line $line in file $file\";\nissubconstant( $somecoderef )\nand say \"this coderef points to a constant subroutine\";\n\n## DESCRIPTION\n\n\"Sub::Identify\" allows you to retrieve the real name of code references.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (1 subsections)\n- **SEE ALSO**\n- **SOURCE**\n- **LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Sub::Identify",
        "section": "",
        "mode": "perldoc",
        "summary": "Sub::Identify - Retrieve names of code references",
        "synopsis": "use Sub::Identify ':all';\nmy $subname = subname( $somecoderef );\nmy $packagename = stashname( $somecoderef );\n# or, to get all at once...\nmy $fullyqualifiedname = subfullname( $somecoderef );\ndefined $subname\nand say \"this coderef points to sub $subname in package $packagename\";\nmy ($file, $line) = getcodelocation( $somecoderef );\n$file\nand say \"this coderef is defined at line $line in file $file\";\nissubconstant( $somecoderef )\nand say \"this coderef points to a constant subroutine\";",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 19,
                "subsections": [
                    {
                        "name": "Pure-Perl version",
                        "lines": 6
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "SOURCE",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Sub::Identify - Retrieve names of code references\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Sub::Identify ':all';\nmy $subname = subname( $somecoderef );\nmy $packagename = stashname( $somecoderef );\n# or, to get all at once...\nmy $fullyqualifiedname = subfullname( $somecoderef );\ndefined $subname\nand say \"this coderef points to sub $subname in package $packagename\";\nmy ($file, $line) = getcodelocation( $somecoderef );\n$file\nand say \"this coderef is defined at line $line in file $file\";\nissubconstant( $somecoderef )\nand say \"this coderef points to a constant subroutine\";\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "\"Sub::Identify\" allows you to retrieve the real name of code references.\n\nIt provides six functions, all of them taking a code reference.\n\n\"subname\" returns the name of the code reference passed as an argument (or \"ANON\" if it's\nan anonymous code reference), \"stashname\" returns its package, and \"subfullname\" returns the\nconcatenation of the two.\n\n\"getcodeinfo\" returns a list of two elements, the package and the subroutine name (in case of\nyou want both and are worried by the speed.)\n\nIn case of subroutine aliasing, those functions always return the original name.\n\n\"getcodelocation\" returns a two-element list containing the file name and the line number\nwhere the subroutine has been defined.\n\n\"issubconstant\" returns a boolean value indicating whether the subroutine is a constant or\nnot.\n",
                "subsections": [
                    {
                        "name": "Pure-Perl version",
                        "content": "By default \"Sub::Identify\" tries to load an XS implementation of the \"getcodeinfo\",\n\"getcodelocation\" and (on perl versions 5.16.0 and later) \"issubconstant\" functions, for\nspeed; if that fails, or if the environment variable \"PERLSUBIDENTIFYPP\" is defined to a true\nvalue, it will fall back to a pure perl implementation, that uses perl's introspection\nmechanism, provided by the \"B\" module.\n"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "Sub::Util, part of the module distribution Scalar::List::Utils since version 1.40. Since this\nwill be a core module starting with perl 5.22.0, it is encouraged to migrate to Sub::Util when\npossible.\n\nSub::Name\n",
                "subsections": []
            },
            "SOURCE": {
                "content": "A git repository for the sources is at <https://github.com/rgs/Sub-Identify>.\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "(c) Rafael Garcia-Suarez (rgs at consttype dot org) 2005, 2008, 2012, 2014, 2015\n\nThis program is free software; you may redistribute it and/or modify it under the same terms as\nPerl itself.\n",
                "subsections": []
            }
        }
    }
}