{
    "content": [
        {
            "type": "text",
            "text": "# Sub::Exporter::Util (perldoc)\n\n## NAME\n\nSub::Exporter::Util - utilities to make Sub::Exporter easier\n\n## DESCRIPTION\n\nThis module provides a number of utility functions for performing common or useful operations\nwhen setting up a Sub::Exporter configuration. All of the utilities may be exported, but none\nare by default.\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **DESCRIPTION**\n- **PERL VERSION SUPPORT**\n- **THE UTILITIES**\n- **AUTHOR**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Sub::Exporter::Util",
        "section": "",
        "mode": "perldoc",
        "summary": "Sub::Exporter::Util - utilities to make Sub::Exporter easier",
        "synopsis": null,
        "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": "DESCRIPTION",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "PERL VERSION SUPPORT",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "THE UTILITIES",
                "lines": 101,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Sub::Exporter::Util - utilities to make Sub::Exporter easier\n",
                "subsections": []
            },
            "VERSION": {
                "content": "version 0.988\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This module provides a number of utility functions for performing common or useful operations\nwhen setting up a Sub::Exporter configuration. All of the utilities may be exported, but none\nare by default.\n",
                "subsections": []
            },
            "PERL VERSION SUPPORT": {
                "content": "This module has a long-term perl support period. That means it will not require a version of\nperl released fewer than five years ago.\n\nAlthough it may work on older versions of perl, no guarantee is made that the minimum required\nversion will not be increased. The version may be increased for any reason, and there is no\npromise that patches will be accepted to lower the minimum required perl.\n",
                "subsections": []
            },
            "THE UTILITIES": {
                "content": "currymethod\nexports => {\nsomemethod => currymethod,\n}\n\nThis utility returns a generator which will produce an invocant-curried version of a method. In\nother words, it will export a method call with the exporting class built in as the invocant.\n\nA module importing the code some the above example might do this:\n\nuse Some::Module qw(somemethod);\n\nmy $x = somemethod;\n\nThis would be equivalent to:\n\nuse Some::Module;\n\nmy $x = Some::Module->somemethod;\n\nIf Some::Module is subclassed and the subclass's import method is called to import\n\"somemethod\", the subclass will be curried in as the invocant.\n\nIf an argument is provided for \"currymethod\" it is used as the name of the curried method to\nexport. This means you could export a Widget constructor like this:\n\nexports => { widget => currymethod('new') }\n\nThis utility may also be called as \"curryclass\", for backwards compatibility.\n\ncurrychain\n\"currychain\" behaves like \"currymethod\", but is meant for generating exports that will call\nseveral methods in succession.\n\nexports => {\nreticulate => currychain(\nnew => gatherdata => analyze => [ detail => 100 ] => 'results'\n),\n}\n\nIf imported from Spliner, calling the \"reticulate\" routine will be equivalent to:\n\nSpliner->new->gatherdata->analyze(detail => 100)->results;\n\nIf any method returns something on which methods may not be called, the routine croaks.\n\nThe arguments to \"currychain\" form an optlist. The names are methods to be called and the\narguments, if given, are arrayrefs to be dereferenced and passed as arguments to those methods.\n\"currychain\" returns a generator like those expected by Sub::Exporter.\n\nAchtung! at present, there is no way to pass arguments from the generated routine to the method\ncalls. This will probably be solved in future revisions by allowing the opt list's values to be\nsubroutines that will be called with the generated routine's stack.\n\nmergecol\nexports => {\nmergecol(defaults => {\ntwiddle => \\'twiddlegen',\ntweak   => \\&tweakgen,\n}),\n}\n\nThis utility wraps the given generator in one that will merge the named collection into its args\nbefore calling it. This means that you can support a \"default\" collector in multiple exports\nwithout writing the code each time.\n\nYou can specify as many pairs of collection names and generators as you like.\n\nmixininstaller\nuse Sub::Exporter -setup => {\ninstaller => Sub::Exporter::Util::mixininstaller,\nexports   => [ qw(foo bar baz) ],\n};\n\nThis utility returns an installer that will install into a superclass and adjust the ISA\nimporting class to include the newly generated superclass.\n\nIf the target of importing is an object, the hierarchy is reversed: the new class will be ISA\nthe object's class, and the object will be reblessed.\n\nPrerequisites: This utility requires that Package::Generator be installed.\n\nlike\nIt's a collector that adds imports for anything like given regex.\n\nIf you provide this configuration:\n\nexports    => [ qw(igrep imap islurp exhausted) ],\ncollectors => { -like => Sub::Exporter::Util::like },\n\nA user may import from your module like this:\n\nuse Your::Iterator -like => qr/^i/; # imports igre, imap, islurp\n\nor\n\nuse Your::Iterator -like => [ qr/^i/ => { -prefix => 'your' } ];\n\nThe group-like prefix and suffix arguments are respected; other arguments are passed on to the\ngenerators for matching exports.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Ricardo Signes <rjbs@semiotic.systems>\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "This software is copyright (c) 2007 by Ricardo Signes.\n\nThis is free software; you can redistribute it and/or modify it under the same terms as the Perl\n5 programming language system itself.\n",
                "subsections": []
            }
        }
    }
}