{
    "mode": "perldoc",
    "parameter": "Eval::TypeTiny",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Eval%3A%3ATypeTiny/json",
    "generated": "2026-06-12T11:21:38Z",
    "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": []
        }
    },
    "summary": "Eval::TypeTiny - utility to evaluate a string of Perl code in a clean environment",
    "flags": [],
    "examples": [],
    "see_also": []
}