{
    "content": [
        {
            "type": "text",
            "text": "# namespace::autoclean (info)\n\n## NAME\n\nnamespace::autoclean - Keep imports out of your namespace\n\n## SYNOPSIS\n\npackage Foo;\nuse namespace::autoclean;\nuse Some::Package qw/importedfunction/;\nsub bar { importedfunction('stuff') }\n# later on:\nFoo->bar;               # works\nFoo->importedfunction; # will fail. importedfunction got cleaned after compilation\n\n## DESCRIPTION\n\nWhen you import a function into a Perl package, it will naturally also\nbe available as a method.\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **PARAMETERS**\n- **CAVEATS**\n- **SEE ALSO**\n- **SUPPORT**\n- **AUTHOR**\n- **CONTRIBUTORS**\n- **COPYRIGHT AND LICENCE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "namespace::autoclean",
        "section": "",
        "mode": "info",
        "summary": "namespace::autoclean - Keep imports out of your namespace",
        "synopsis": "package Foo;\nuse namespace::autoclean;\nuse Some::Package qw/importedfunction/;\nsub bar { importedfunction('stuff') }\n# later on:\nFoo->bar;               # works\nFoo->importedfunction; # will fail. importedfunction got cleaned after compilation",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 36,
                "subsections": []
            },
            {
                "name": "PARAMETERS",
                "lines": 36,
                "subsections": []
            },
            {
                "name": "CAVEATS",
                "lines": 16,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 16,
                "subsections": []
            },
            {
                "name": "SUPPORT",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "CONTRIBUTORS",
                "lines": 18,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENCE",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "namespace::autoclean - Keep imports out of your namespace\n",
                "subsections": []
            },
            "VERSION": {
                "content": "version 0.29\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "package Foo;\nuse namespace::autoclean;\nuse Some::Package qw/importedfunction/;\n\nsub bar { importedfunction('stuff') }\n\n# later on:\nFoo->bar;               # works\nFoo->importedfunction; # will fail. importedfunction got cleaned after compilation\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "When you import a function into a Perl package, it will naturally also\nbe available as a method.\n\nThe \"namespace::autoclean\" pragma will remove all imported symbols at\nthe end of the current package's compile cycle. Functions called in the\npackage itself will still be bound by their name, but they won't show\nup as methods on your class or instances.\n\nThis module is very similar to namespace::clean, except it will clean\nall imported functions, no matter if you imported them before or after\nyou \"use\"d the pragma. It will also not touch anything that looks like\na method.\n\nIf you're writing an exporter and you want to clean up after yourself\n(and your peers), you can use the \"-cleanee\" switch to specify what\npackage to clean:\n\npackage My::MooseX::namespace::autoclean;\nuse strict;\n\nuse namespace::autoclean (); # no cleanup, just load\n\nsub import {\nnamespace::autoclean->import(\n-cleanee => scalar(caller),\n);\n}\n\nWHAT IS AND ISN'T CLEANED\n\"namespace::autoclean\" will leave behind anything that it deems a\nmethod.  For Moose classes, this the based on the \"getmethodlist\"\nmethod on from the Class::MOP::Class.  For non-Moose classes, anything\ndefined within the package will be identified as a method.  This should\nmatch Moose's definition of a method.  Additionally, the magic subs\ninstalled by overload will not be cleaned.\n",
                "subsections": []
            },
            "PARAMETERS": {
                "content": "-also => [ ITEM | REGEX | SUB, .. ]\n-also => ITEM\n-also => REGEX\n-also => SUB\nSometimes you don't want to clean imports only, but also helper\nfunctions you're using in your methods. The \"-also\" switch can be used\nto declare a list of functions that should be removed additional to any\nimports:\n\nuse namespace::autoclean -also => ['somefunction', 'anotherfunction'];\n\nIf only one function needs to be additionally cleaned the \"-also\"\nswitch also accepts a plain string:\n\nuse namespace::autoclean -also => 'somefunction';\n\nIn some situations, you may wish for a more powerful cleaning solution.\n\nThe \"-also\" switch can take a Regex or a CodeRef to match against local\nfunction names to clean.\n\nuse namespace::autoclean -also => qr/^/\n\nuse namespace::autoclean -also => sub { $ =~ m{^} };\n\nuse namespace::autoclean -also => [qr/^/ , qr/^hidden/ ];\n\nuse namespace::autoclean -also => [sub { $ =~ m/^/ or $ =~ m/^hidden/ }, sub { uc($) == $ } ];\n\n-except => [ ITEM | REGEX | SUB, .. ]\n-except => ITEM\n-except => REGEX\n-except => SUB\nThis takes exactly the same options as \"-also\" except that anything\nthis matches will not be cleaned.\n",
                "subsections": []
            },
            "CAVEATS": {
                "content": "When used with Moo classes, the heuristic used to check for methods\nwon't work correctly for methods from roles consumed at compile time.\n\npackage My::Class;\nuse Moo;\nuse namespace::autoclean;\n\n# Bad, any consumed methods will be cleaned\nBEGIN { with 'Some::Role' }\n\n# Good, methods from role will be maintained\nwith 'Some::Role';\n\nAdditionally, method detection may not work properly in Mouse classes\nin perls earlier than 5.10.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "o   namespace::clean\n\no   B::Hooks::EndOfScope\n\no   namespace::sweep\n\no   Sub::Exporter::ForMethods\n\no   Sub::Name\n\no   Sub::Install\n\no   Test::CleanNamespaces\n\no   Dist::Zilla::Plugin::Test::CleanNamespaces\n",
                "subsections": []
            },
            "SUPPORT": {
                "content": "Bugs may be submitted through the RT bug tracker\n<https://rt.cpan.org/Public/Dist/Display.html?Name=namespace-autoclean>\n(or bug-namespace-autoclean@rt.cpan.org <mailto:bug-namespace-\nautoclean@rt.cpan.org>).\n\nThere is also a mailing list available for users of this distribution,\nat <http://lists.perl.org/list/moose.html>.\n\nThere is also an irc channel available for users of this distribution,\nat \"#moose\" on \"irc.perl.org\" <irc://irc.perl.org/#moose>.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Florian Ragwitz <rafl@debian.org>\n",
                "subsections": []
            },
            "CONTRIBUTORS": {
                "content": "o   Karen Etheridge <ether@cpan.org>\n\no   Graham Knop <haarg@haarg.org>\n\no   Dave Rolsky <autarch@urth.org>\n\no   Kent Fredric <kentfredric@gmail.com>\n\no   Tomas Doran <bobtfish@bobtfish.net>\n\no   Shawn M Moore <cpan@sartak.org>\n\no   Felix Ostmann <sadrak@cpan.org>\n\no   Chris Prather <chris@prather.org>\n\no   Andrew Rodland <arodland@cpan.org>\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENCE": {
                "content": "This software is copyright (c) 2009 by Florian Ragwitz.\n\nThis is free software; you can redistribute it and/or modify it under\nthe same terms as the Perl 5 programming language system itself.\n\nperl v5.30.0                      2019-10-13         namespace::autoclean(3pm)",
                "subsections": []
            }
        }
    }
}