{
    "mode": "perldoc",
    "parameter": "Type::Parser",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Type%3A%3AParser/json",
    "generated": "2026-06-10T03:30:45Z",
    "synopsis": "use v5.10;\nuse strict;\nuse warnings;\nuse Type::Parser qw( evaltype );\nuse Type::Registry;\nmy $reg = Type::Registry->forme;\n$reg->addtypes(\"Types::Standard\");\nmy $type = evaltype(\"Int | ArrayRef[Int]\", $reg);\n$type->check(10);        # true\n$type->check([1..4]);    # true\n$type->check({foo=>1});  # false",
    "sections": {
        "NAME": {
            "content": "Type::Parser - parse type constraint strings\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use v5.10;\nuse strict;\nuse warnings;\n\nuse Type::Parser qw( evaltype );\nuse Type::Registry;\n\nmy $reg = Type::Registry->forme;\n$reg->addtypes(\"Types::Standard\");\n\nmy $type = evaltype(\"Int | ArrayRef[Int]\", $reg);\n\n$type->check(10);        # true\n$type->check([1..4]);    # true\n$type->check({foo=>1});  # false\n",
            "subsections": []
        },
        "STATUS": {
            "content": "This module is covered by the Type-Tiny stability policy.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Generally speaking, you probably don't want to be using this module directly. Instead use the\n\"lookup\" method from Type::Registry which wraps it.\n",
            "subsections": [
                {
                    "name": "Functions",
                    "content": "\"parse($string)\"\nParse the type constraint string into something like an AST.\n\nIf called in list context, also returns any \"tail\" found on the original string.\n\n\"extracttype($string, $registry)\"\nCompile a type constraint string into a Type::Tiny object.\n\nIf called in list context, also returns any \"tail\" found on the original string.\n\n\"evaltype($string, $registry)\"\nCompile a type constraint string into a Type::Tiny object.\n\nThrows an error if the \"tail\" contains any non-whitespace character.\n"
                },
                {
                    "name": "Constants",
                    "content": "The following constants correspond to values returned by \"$token->type\".\n\n\"TYPE\"\n\"QUOTELIKE\"\n\"STRING\"\n\"HEXNUM\"\n\"CLASS\"\n\"LBRACKET\"\n\"RBRACKET\"\n\"COMMA\"\n\"SLURPY\"\n\"UNION\"\n\"INTERSECT\"\n\"NOT\"\n\"LPAREN\"\n\"RPAREN\"\n\"MYSTERY\"\n"
                }
            ]
        },
        "BUGS": {
            "content": "Please report any bugs to <https://github.com/tobyink/p5-type-tiny/issues>.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Type::Registry.\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": "Type::Parser - parse type constraint strings",
    "flags": [],
    "examples": [],
    "see_also": []
}