{
    "mode": "perldoc",
    "parameter": "autodie::Scope::Guard",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/autodie%3A%3AScope%3A%3AGuard/json",
    "generated": "2026-06-03T01:26:15Z",
    "synopsis": "use autodie::Scope::Guard;\n$^H{'my-key'} = autodie::Scope::Guard->new(sub {\nprint \"Hallo world\\n\";\n});",
    "sections": {
        "NAME": {
            "content": "autodie::Scope::Guard - Wrapper class for calling subs at end of scope\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use autodie::Scope::Guard;\n$^H{'my-key'} = autodie::Scope::Guard->new(sub {\nprint \"Hallo world\\n\";\n});\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This class is used to bless perl subs so that they are invoked when they are destroyed. This is\nmostly useful for ensuring the code is invoked at end of scope. This module is not a part of\nautodie's public API.\n\nThis module is directly inspired by chocolateboy's excellent Scope::Guard module.\n",
            "subsections": [
                {
                    "name": "Methods",
                    "content": "new\nmy $hook = autodie::Scope::Guard->new(sub {});\n\nCreates a new \"autodie::Scope::Guard\", which will invoke the given sub once it goes out of scope\n(i.e. its DESTROY handler is called).\n"
                }
            ]
        },
        "AUTHOR": {
            "content": "Copyright 2008-2009, Paul Fenwick <pjf@perltraining.com.au>\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "This module is free software. You may distribute it under the same terms as Perl itself.\n",
            "subsections": []
        }
    },
    "summary": "autodie::Scope::Guard - Wrapper class for calling subs at end of scope",
    "flags": [],
    "examples": [],
    "see_also": []
}