{
    "content": [
        {
            "type": "text",
            "text": "# Eval::TypeTiny (perldoc)\n\n## NAME\n\nEval::TypeTiny - utility to evaluate a string of Perl code in a clean environment\n\n## DESCRIPTION\n\nThis module is used by Type::Tiny to compile coderefs from strings of Perl code, and hashrefs of\nvariables to close over.\n\n## Sections\n\n- **NAME**\n- **STATUS**\n- **DESCRIPTION** (2 subsections)\n- **EVALUATION ENVIRONMENT**\n- **BUGS**\n- **SEE ALSO**\n- **AUTHOR**\n- **COPYRIGHT AND LICENCE**\n- **DISCLAIMER OF WARRANTIES**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Eval::TypeTiny",
        "section": "",
        "mode": "perldoc",
        "summary": "Eval::TypeTiny - utility to evaluate a string of Perl code in a clean environment",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "STATUS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": [
                    {
                        "name": "Functions",
                        "lines": 5
                    },
                    {
                        "name": "Constants",
                        "lines": 30
                    }
                ]
            },
            {
                "name": "EVALUATION ENVIRONMENT",
                "lines": 23,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENCE",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "DISCLAIMER OF WARRANTIES",
                "lines": 4,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Eval::TypeTiny - utility to evaluate a string of Perl code in a clean environment\n",
                "subsections": []
            },
            "STATUS": {
                "content": "This module is covered by the Type-Tiny stability policy.\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This module is used by Type::Tiny to compile coderefs from strings of Perl code, and hashrefs of\nvariables to close over.\n",
                "subsections": [
                    {
                        "name": "Functions",
                        "content": "This module exports one function, which works much like the similarly named function from\nEval::Closure:\n\n\"evalclosure(source => $source, environment => \\%env, %opt)\"\n"
                    },
                    {
                        "name": "Constants",
                        "content": "The following constants may be exported, but are not by default.\n\n\"HASLEXICALSUBS\"\nBoolean indicating whether Eval::TypeTiny has support for lexical subs. (This feature\nrequires Perl 5.18.)\n\n\"ALIASIMPLEMENTATION\"\nReturns a string indicating what implementation of \"alias => 1\" is being used.\nEval::TypeTiny will automatically choose the best implementation. This constant can be\nmatched against the \"IMPLEMENTAION*\" constants.\n\n\"IMPLEMENTATIONNATIVE\"\nIf \"ALIASIMPLEMENTATION eq IMPLEMENTATIONNATIVE\" then Eval::TypeTiny is currently using\nPerl 5.22's native alias feature. This requires Perl 5.22.\n\n\"IMPLEMENTATIONDEVELLEXALIAS\"\nIf \"ALIASIMPLEMENTATION eq IMPLEMENTATIONDEVELLEXALIAS\" then Eval::TypeTiny is currently\nusing Devel::LexAlias to provide aliases.\n\n\"IMPLEMENTATIONPADWALKER\"\nIf \"ALIASIMPLEMENTATION eq IMPLEMENTATIONPADWALKER\" then Eval::TypeTiny is currently using\nPadWalker to provide aliases.\n\n\"IMPLEMENTATIONTIE\"\nIf \"ALIASIMPLEMENTATION eq IMPLEMENTATIONTIE\" then Eval::TypeTiny is using the fallback\nimplementation of aliases using \"tie\". This is the slowest implementation, and may cause\nproblems in certain edge cases, like trying to alias already-tied variables, but it's the\nonly way to implement \"alias => 1\" without a recent version of Perl or one of the two\noptional modules mentioned above.\n"
                    }
                ]
            },
            "EVALUATION ENVIRONMENT": {
                "content": "The evaluation is performed in the presence of strict, but the absence of warnings. (This is\ndifferent to Eval::Closure which enables warnings for compiled closures.)\n\nThe feature pragma is not active in the evaluation environment, so the following will not work:\n\nuse feature qw(say);\nuse Eval::TypeTiny qw(evalclosure);\n\nmy $sayall = evalclosure(\nsource => 'sub { say for @ }',\n);\n$sayall->(\"Hello\", \"World\");\n\nThe feature pragma does not \"carry over\" into the stringy eval. It is of course possible to\nimport pragmas into the evaluated string as part of the string itself:\n\nuse Eval::TypeTiny qw(evalclosure);\n\nmy $sayall = evalclosure(\nsource => 'sub { use feature qw(say); say for @ }',\n);\n$sayall->(\"Hello\", \"World\");\n",
                "subsections": []
            },
            "BUGS": {
                "content": "Please report any bugs to <https://github.com/tobyink/p5-type-tiny/issues>.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Eval::Closure, Error::TypeTiny::Compilation.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Toby Inkster <tobyink@cpan.org>.\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENCE": {
                "content": "This software is copyright (c) 2013-2014, 2017-2021 by Toby Inkster.\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": []
            },
            "DISCLAIMER OF WARRANTIES": {
                "content": "THIS PACKAGE IS PROVIDED \"AS IS\" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,\nWITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.\n",
                "subsections": []
            }
        }
    }
}