{
    "mode": "perldoc",
    "parameter": "Class::MOP::Method::Accessor",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Class%3A%3AMOP%3A%3AMethod%3A%3AAccessor/json",
    "generated": "2026-06-09T21:37:55Z",
    "synopsis": "use Class::MOP::Method::Accessor;\nmy $reader = Class::MOP::Method::Accessor->new(\nattribute     => $attribute,\nisinline     => 1,\naccessortype => 'reader',\n);\n$reader->body->execute($instance); # call the reader method",
    "sections": {
        "NAME": {
            "content": "Class::MOP::Method::Accessor - Method Meta Object for accessors\n",
            "subsections": []
        },
        "VERSION": {
            "content": "version 2.2200\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Class::MOP::Method::Accessor;\n\nmy $reader = Class::MOP::Method::Accessor->new(\nattribute     => $attribute,\nisinline     => 1,\naccessortype => 'reader',\n);\n\n$reader->body->execute($instance); # call the reader method\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This is a subclass of \"Class::MOP::Method\" which is used by \"Class::MOP::Attribute\" to generate\naccessor code. It handles generation of readers, writers, predicates and clearers. For each type\nof method, it can either create a subroutine reference, or actually inline code by generating a\nstring and \"eval\"'ing it.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "Class::MOP::Method::Accessor->new(%options)\nThis returns a new \"Class::MOP::Method::Accessor\" based on the %options provided.\n\n*   attribute\n\nThis is the \"Class::MOP::Attribute\" for which accessors are being generated. This option\nis required.\n\n*   accessortype\n\nThis is a string which should be one of \"reader\", \"writer\", \"accessor\", \"predicate\", or\n\"clearer\". This is the type of method being generated. This option is required.\n\n*   isinline\n\nThis indicates whether or not the accessor should be inlined. This defaults to false.\n\n*   name\n\nThe method name (without a package name). This is required.\n\n*   packagename\n\nThe package name for the method. This is required.\n\n$metamethod->accessortype\nReturns the accessor type which was passed to \"new\".\n\n$metamethod->isinline\nReturns a boolean indicating whether or not the accessor is inlined.\n\n$metamethod->associatedattribute\nThis returns the Class::MOP::Attribute object which was passed to \"new\".\n\n$metamethod->body\nThe method itself is *generated* when the accessor object is constructed.\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::Accessor - Method Meta Object for accessors",
    "flags": [],
    "examples": [],
    "see_also": []
}