{
    "content": [
        {
            "type": "text",
            "text": "# autodie::Scope::GuardStack (perldoc)\n\n## NAME\n\nautodie::Scope::GuardStack - Hook stack for managing scopes via %^H\n\n## SYNOPSIS\n\nuse autodie::Scope::GuardStack;\nmy $stack = autodie::Scope::GuardStack->new\n$^H{'my-key'} = $stack;\n$stack->pushhook(sub {});\n\n## DESCRIPTION\n\nThis class is a stack of hooks to be called in the right order as scopes go away. The stack is\nonly useful when inserted into \"%^H\" and will pop hooks as their \"scope\" is popped. This is\nuseful for uninstalling or reinstalling subs in a namespace as a pragma goes out of scope.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (1 subsections)\n- **AUTHOR**\n- **LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "autodie::Scope::GuardStack",
        "section": "",
        "mode": "perldoc",
        "summary": "autodie::Scope::GuardStack - Hook stack for managing scopes via %^H",
        "synopsis": "use autodie::Scope::GuardStack;\nmy $stack = autodie::Scope::GuardStack->new\n$^H{'my-key'} = $stack;\n$stack->pushhook(sub {});",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 8,
                "subsections": [
                    {
                        "name": "Methods",
                        "lines": 12
                    }
                ]
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "autodie::Scope::GuardStack - Hook stack for managing scopes via %^H\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use autodie::Scope::GuardStack;\nmy $stack = autodie::Scope::GuardStack->new\n$^H{'my-key'} = $stack;\n\n$stack->pushhook(sub {});\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This class is a stack of hooks to be called in the right order as scopes go away. The stack is\nonly useful when inserted into \"%^H\" and will pop hooks as their \"scope\" is popped. This is\nuseful for uninstalling or reinstalling subs in a namespace as a pragma goes out of scope.\n\nDue to how \"%^H\" works, this class is only useful during the compilation phase of a perl module\nand relies on the internals of how perl handles references in \"%^H\". This module is not a part\nof autodie's public API.\n",
                "subsections": [
                    {
                        "name": "Methods",
                        "content": "new\nmy $stack = autodie::Scope::GuardStack->new;\n\nCreates a new \"autodie::Scope::GuardStack\". The stack is initially empty and must be inserted\ninto \"%^H\" by the creator.\n\npushhook\n$stack->pushhook(sub {});\n\nAdd a sub to the stack. The sub will be called once the current compile-time \"scope\" is left.\nMultiple hooks can be added per scope\n"
                    }
                ]
            },
            "AUTHOR": {
                "content": "Copyright 2013, Niels Thykier <niels@thykier.net>\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "This module is free software. You may distribute it under the same terms as Perl itself.\n",
                "subsections": []
            }
        }
    }
}