{
    "mode": "perldoc",
    "parameter": "Class::MOP::Method",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Class%3A%3AMOP%3A%3AMethod/json",
    "generated": "2026-06-15T14:44:55Z",
    "sections": {
        "NAME": {
            "content": "Class::MOP::Method - Method Meta Object\n",
            "subsections": []
        },
        "VERSION": {
            "content": "version 2.2200\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The Method Protocol is very small, since methods in Perl 5 are just subroutines in a specific\npackage. We provide a very basic introspection interface.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "Class::MOP::Method->wrap($code, %options)\nThis is the constructor. It accepts a method body in the form of either a code reference or\na Class::MOP::Method instance, followed by a hash of options.\n\nThe options are:\n\n*       name\n\nThe method name (without a package name). This is required if $code is a coderef.\n\n*       packagename\n\nThe package name for the method. This is required if $code is a coderef.\n\n*       associatedmetaclass\n\nAn optional Class::MOP::Class object. This is the metaclass for the method's class.\n\n$metamethod->clone(%params)\nThis makes a shallow clone of the method object. In particular, subroutine reference itself\nis shared between all clones of a given method.\n\nWhen a method is cloned, the original method object will be available by calling\n\"originalmethod\" on the clone.\n\n$metamethod->body\nThis returns a reference to the method's subroutine.\n\n$metamethod->name\nThis returns the method's name.\n\n$metamethod->packagename\nThis returns the method's package name.\n\n$metamethod->fullyqualifiedname\nThis returns the method's fully qualified name (package name and method name).\n\n$metamethod->associatedmetaclass\nThis returns the Class::MOP::Class object for the method, if one exists.\n\n$metamethod->originalmethod\nIf this method object was created as a clone of some other method object, this returns the\nobject that was cloned.\n\n$metamethod->originalname\nThis returns the method's original name, wherever it was first defined.\n\nIf this method is a clone of a clone (of a clone, etc.), this method returns the name from\nthe *first* method in the chain of clones.\n\n$metamethod->originalpackagename\nThis returns the method's original package name, wherever it was first defined.\n\nIf this method is a clone of a clone (of a clone, etc.), this method returns the package\nname from the *first* method in the chain of clones.\n\n$metamethod->originalfullyqualifiedname\nThis returns the method's original fully qualified name, wherever it was first defined.\n\nIf this method is a clone of a clone (of a clone, etc.), this method returns the fully\nqualified name from the *first* method in the chain of clones.\n\n$metamethod->isstub\nReturns true if the method is just a stub:\n\nsub foo;\n\n$metamethod->attachtoclass($metaclass)\nGiven a Class::MOP::Class object, this method sets the associated metaclass for the method.\nThis will overwrite any existing associated metaclass.\n\n$metamethod->detachfromclass\nRemoves any associated metaclass object for the method.\n\n$metamethod->execute(...)\nThis executes the method. Any arguments provided will be passed on to the method itself.\n\nClass::MOP::Method->meta\nThis will return a Class::MOP::Class instance for this class.\n\nIt should also be noted that Class::MOP will actually bootstrap this module by installing a\nnumber of attribute meta-objects into its metaclass.\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": "Class::MOP::Method - Method Meta Object",
    "flags": [],
    "examples": [],
    "see_also": []
}