{
    "mode": "perldoc",
    "parameter": "Moose::Meta::TypeCoercion",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Moose%3A%3AMeta%3A%3ATypeCoercion/json",
    "generated": "2026-06-10T20:18:43Z",
    "sections": {
        "NAME": {
            "content": "Moose::Meta::TypeCoercion - The Moose Type Coercion metaclass\n",
            "subsections": []
        },
        "VERSION": {
            "content": "version 2.2200\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "A type coercion object is basically a mapping of one or more type constraints and the associated\ncoercions subroutines.\n\nIt's unlikely that you will need to instantiate an object of this class directly, as it's part\nof the deep internals of Moose.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "Moose::Meta::TypeCoercion->new(%options)\nCreates a new type coercion object, based on the options provided.\n\n*   typeconstraint\n\nThis is the Moose::Meta::TypeConstraint object for the type that is being coerced *to*.\n\n$coercion->typecoercionmap\nThis returns the map of type constraints to coercions as an array reference. The values of the\narray alternate between type names and subroutine references which implement the coercion.\n\nThe value is an array reference because coercions are tried in the order they are added.\n\n$coercion->typeconstraint\nThis returns the Moose::Meta::TypeConstraint that was passed to the constructor.\n\n$coercion->hascoercionfortype($typename)\nReturns true if the coercion can coerce the named type.\n\n$coercion->addtypecoercions( $typename => $sub, ... )\nThis method takes a list of type names and subroutine references. If the coercion already has a\nmapping for a given type, it throws an exception.\n\nCoercions are actually\n\n$coercion->coerce($value)\nThis method takes a value and applies the first valid coercion it finds.\n\nThis means that if the value could belong to more than type in the coercion object, the first\ncoercion added is used.\n\nMoose::Meta::TypeCoercion->meta\nThis will return a Class::MOP::Class instance for this class.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "See \"BUGS\" in Moose for details on reporting bugs.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "*   Stevan Little <stevan@cpan.org>\n\n*   Dave Rolsky <autarch@urth.org>\n\n*   Jesse Luehrs <doy@cpan.org>\n\n*   Shawn M Moore <sartak@cpan.org>\n\n*   יובל קוג'מן (Yuval Kogman) <nothingmuch@woobling.org>\n\n*   Karen Etheridge <ether@cpan.org>\n\n*   Florian Ragwitz <rafl@debian.org>\n\n*   Hans Dieter Pearcey <hdp@cpan.org>\n\n*   Chris Prather <chris@prather.org>\n\n*   Matt S Trout <mstrout@cpan.org>\n",
            "subsections": []
        },
        "COPYRIGHT AND LICENSE": {
            "content": "This software is copyright (c) 2006 by Infinity Interactive, Inc.\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": []
        }
    },
    "summary": "Moose::Meta::TypeCoercion - The Moose Type Coercion metaclass",
    "flags": [],
    "examples": [],
    "see_also": []
}