{
    "content": [
        {
            "type": "text",
            "text": "# Moo (man)\n\n## NAME\n\nMoo - Minimalist Object Orientation (with Moose compatibility)\n\n## SYNOPSIS\n\npackage Cat::Food;\nuse Moo;\nuse strictures 2;\nuse namespace::clean;\nsub feedlion {\nmy $self = shift;\nmy $amount = shift || 1;\n$self->pounds( $self->pounds - $amount );\n}\nhas taste => (\nis => 'ro',\n);\nhas brand => (\nis  => 'ro',\nisa => sub {\ndie \"Only SWEET-TREATZ supported!\" unless $[0] eq 'SWEET-TREATZ'\n},\n);\nhas pounds => (\nis  => 'rw',\nisa => sub { die \"$[0] is too much cat food!\" unless $[0] < 15 },\n);\n1;\nAnd elsewhere:\nmy $full = Cat::Food->new(\ntaste  => 'DELICIOUS.',\nbrand  => 'SWEET-TREATZ',\npounds => 10,\n);\n$full->feedlion;\nsay $full->pounds;\n\n## DESCRIPTION\n\n\"Moo\" is an extremely light-weight Object Orientation system. It allows one to concisely\ndefine objects and roles with a convenient syntax that avoids the details of Perl's object\nsystem.  \"Moo\" contains a subset of Moose and is optimised for rapid startup.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **WHY MOO EXISTS**\n- **MOO AND MOOSE** (2 subsections)\n- **PUBLIC METHODS** (3 subsections)\n- **LIFECYCLE METHODS**\n- **IMPORTED SUBROUTINES** (6 subsections)\n- **SUB QUOTE AWARE**\n- **CLEANING UP IMPORTS**\n- **INCOMPATIBILITIES WITH MOOSE**\n- **COMPATIBILITY WITH OLDER PERL VERSIONS**\n- **SUPPORT**\n- **AUTHOR**\n- **CONTRIBUTORS**\n- **COPYRIGHT**\n- **LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Moo",
        "section": "",
        "mode": "man",
        "summary": "Moo - Minimalist Object Orientation (with Moose compatibility)",
        "synopsis": "package Cat::Food;\nuse Moo;\nuse strictures 2;\nuse namespace::clean;\nsub feedlion {\nmy $self = shift;\nmy $amount = shift || 1;\n$self->pounds( $self->pounds - $amount );\n}\nhas taste => (\nis => 'ro',\n);\nhas brand => (\nis  => 'ro',\nisa => sub {\ndie \"Only SWEET-TREATZ supported!\" unless $[0] eq 'SWEET-TREATZ'\n},\n);\nhas pounds => (\nis  => 'rw',\nisa => sub { die \"$[0] is too much cat food!\" unless $[0] < 15 },\n);\n1;\nAnd elsewhere:\nmy $full = Cat::Food->new(\ntaste  => 'DELICIOUS.',\nbrand  => 'SWEET-TREATZ',\npounds => 10,\n);\n$full->feedlion;\nsay $full->pounds;",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 43,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 16,
                "subsections": []
            },
            {
                "name": "WHY MOO EXISTS",
                "lines": 16,
                "subsections": []
            },
            {
                "name": "MOO AND MOOSE",
                "lines": 26,
                "subsections": [
                    {
                        "name": "MOO AND CLASS::XSACCESSOR",
                        "lines": 6
                    },
                    {
                        "name": "MOO VERSUS ANY::MOOSE",
                        "lines": 14
                    }
                ]
            },
            {
                "name": "PUBLIC METHODS",
                "lines": 2,
                "subsections": [
                    {
                        "name": "new",
                        "lines": 9
                    },
                    {
                        "name": "does",
                        "lines": 13
                    },
                    {
                        "name": "meta",
                        "lines": 10
                    }
                ]
            },
            {
                "name": "LIFECYCLE METHODS",
                "lines": 66,
                "subsections": []
            },
            {
                "name": "IMPORTED SUBROUTINES",
                "lines": 1,
                "subsections": [
                    {
                        "name": "extends",
                        "lines": 9
                    },
                    {
                        "name": "with",
                        "lines": 10
                    },
                    {
                        "name": "has",
                        "lines": 213
                    },
                    {
                        "name": "before",
                        "lines": 4
                    },
                    {
                        "name": "around",
                        "lines": 4
                    },
                    {
                        "name": "after",
                        "lines": 4
                    }
                ]
            },
            {
                "name": "SUB QUOTE AWARE",
                "lines": 39,
                "subsections": []
            },
            {
                "name": "CLEANING UP IMPORTS",
                "lines": 40,
                "subsections": []
            },
            {
                "name": "INCOMPATIBILITIES WITH MOOSE",
                "lines": 100,
                "subsections": []
            },
            {
                "name": "COMPATIBILITY WITH OLDER PERL VERSIONS",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "SUPPORT",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "CONTRIBUTORS",
                "lines": 34,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Moo - Minimalist Object Orientation (with Moose compatibility)\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "package Cat::Food;\n\nuse Moo;\nuse strictures 2;\nuse namespace::clean;\n\nsub feedlion {\nmy $self = shift;\nmy $amount = shift || 1;\n\n$self->pounds( $self->pounds - $amount );\n}\n\nhas taste => (\nis => 'ro',\n);\n\nhas brand => (\nis  => 'ro',\nisa => sub {\ndie \"Only SWEET-TREATZ supported!\" unless $[0] eq 'SWEET-TREATZ'\n},\n);\n\nhas pounds => (\nis  => 'rw',\nisa => sub { die \"$[0] is too much cat food!\" unless $[0] < 15 },\n);\n\n1;\n\nAnd elsewhere:\n\nmy $full = Cat::Food->new(\ntaste  => 'DELICIOUS.',\nbrand  => 'SWEET-TREATZ',\npounds => 10,\n);\n\n$full->feedlion;\n\nsay $full->pounds;\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "\"Moo\" is an extremely light-weight Object Orientation system. It allows one to concisely\ndefine objects and roles with a convenient syntax that avoids the details of Perl's object\nsystem.  \"Moo\" contains a subset of Moose and is optimised for rapid startup.\n\n\"Moo\" avoids depending on any XS modules to allow for simple deployments.  The name \"Moo\" is\nbased on the idea that it provides almost -- but not quite -- two thirds of Moose.  As such,\nthe Moose::Manual can serve as an effective guide to \"Moo\" aside from the MOP and Types\nsections.\n\nUnlike Mouse this module does not aim at full compatibility with Moose's surface syntax,\npreferring instead to provide full interoperability via the metaclass inflation capabilities\ndescribed in \"MOO AND MOOSE\".\n\nFor a full list of the minor differences between Moose and Moo's surface syntax, see\n\"INCOMPATIBILITIES WITH MOOSE\".\n",
                "subsections": []
            },
            "WHY MOO EXISTS": {
                "content": "If you want a full object system with a rich Metaprotocol, Moose is already wonderful.\n\nBut if you don't want to use Moose, you may not want \"less metaprotocol\" like Mouse offers,\nbut you probably want \"no metaprotocol\", which is what Moo provides. \"Moo\" is ideal for some\nsituations where deployment or startup time precludes using Moose and Mouse:\n\na command line or CGI script where fast startup is essential\ncode designed to be deployed as a single file via App::FatPacker\na CPAN module that may be used by others in the above situations\n\n\"Moo\" maintains transparent compatibility with Moose so if you install and load Moose you can\nuse Moo classes and roles in Moose code without modification.\n\nMoo -- Minimal Object Orientation -- aims to make it smooth to upgrade to Moose when you need\nmore than the minimal features offered by Moo.\n",
                "subsections": []
            },
            "MOO AND MOOSE": {
                "content": "If Moo detects Moose being loaded, it will automatically register metaclasses for your Moo\nand Moo::Role packages, so you should be able to use them in Moose code without modification.\n\nMoo will also create Moose type constraints for Moo classes and roles, so that in Moose\nclasses \"isa => 'MyMooClass'\" and \"isa => 'MyMooRole'\" work the same as for Moose classes and\nroles.\n\nExtending a Moose class or consuming a Moose::Role will also work.\n\nExtending a Mouse class or consuming a Mouse::Role will also work. But note that we don't\nprovide Mouse metaclasses or metaroles so the other way around doesn't work. This feature\nexists for Any::Moose users porting to Moo; enabling Mouse users to use Moo classes is not a\npriority for us.\n\nThis means that there is no need for anything like Any::Moose for Moo code - Moo and Moose\ncode should simply interoperate without problem. To handle Mouse code, you'll likely need an\nempty Moo role or class consuming or extending the Mouse stuff since it doesn't register true\nMoose metaclasses like Moo does.\n\nIf you need to disable the metaclass creation, add:\n\nno Moo::sification;\n\nto your code before Moose is loaded, but bear in mind that this switch is global and turns\nthe mechanism off entirely so don't put this in library code.\n",
                "subsections": [
                    {
                        "name": "MOO AND CLASS::XSACCESSOR",
                        "content": "If a new enough version of Class::XSAccessor is available, it will be used to generate simple\naccessors, readers, and writers for better performance.  Simple accessors are those without\nlazy defaults, type checks/coercions, or triggers.  Simple readers are those without lazy\ndefaults. Readers and writers generated by Class::XSAccessor will behave slightly\ndifferently: they will reject attempts to call them with the incorrect number of parameters.\n"
                    },
                    {
                        "name": "MOO VERSUS ANY::MOOSE",
                        "content": "Any::Moose will load Mouse normally, and Moose in a program using Moose - which theoretically\nallows you to get the startup time of Mouse without disadvantaging Moose users.\n\nSadly, this doesn't entirely work, since the selection is load order dependent - Moo's\nmetaclass inflation system explained above in \"MOO AND MOOSE\" is significantly more reliable.\n\nSo if you want to write a CPAN module that loads fast or has only pure perl dependencies but\nis also fully usable by Moose users, you should be using Moo.\n\nFor a full explanation, see the article\n<https://shadow.cat/blog/matt-s-trout/moo-versus-any-moose> which explains the differing\nstrategies in more detail and provides a direct example of where Moo succeeds and Any::Moose\nfails.\n"
                    }
                ]
            },
            "PUBLIC METHODS": {
                "content": "Moo provides several methods to any class using it.\n",
                "subsections": [
                    {
                        "name": "new",
                        "content": "Foo::Bar->new( attr1 => 3 );\n\nor\n\nFoo::Bar->new({ attr1 => 3 });\n\nThe constructor for the class.  By default it will accept attributes either as a hashref, or\na list of key value pairs.  This can be customized with the \"BUILDARGS\" method.\n"
                    },
                    {
                        "name": "does",
                        "content": "if ($foo->does('Some::Role1')) {\n...\n}\n\nReturns true if the object composes in the passed role.\n\nDOES\nif ($foo->DOES('Some::Role1') || $foo->DOES('Some::Class1')) {\n...\n}\n\nSimilar to \"does\", but will also return true for both composed roles and superclasses.\n"
                    },
                    {
                        "name": "meta",
                        "content": "my $meta = Foo::Bar->meta;\nmy @methods = $meta->getmethodlist;\n\nReturns an object that will behave as if it is a Moose metaclass object for the class. If you\ncall anything other than \"makeimmutable\" on it, the object will be transparently upgraded to\na genuine Moose::Meta::Class instance, loading Moose in the process if required.\n\"makeimmutable\" itself is a no-op, since we generate metaclasses that are already immutable,\nand users converting from Moose had an unfortunate tendency to accidentally load Moose by\ncalling it.\n"
                    }
                ]
            },
            "LIFECYCLE METHODS": {
                "content": "There are several methods that you can define in your class to control construction and\ndestruction of objects.  They should be used rather than trying to modify \"new\" or \"DESTROY\"\nyourself.\n\nBUILDARGS\naround BUILDARGS => sub {\nmy ( $orig, $class, @args ) = @;\n\nreturn { attr1 => $args[0] }\nif @args == 1 && !ref $args[0];\n\nreturn $class->$orig(@args);\n};\n\nFoo::Bar->new( 3 );\n\nThis class method is used to transform the arguments to \"new\" into a hash reference of\nattribute values.\n\nThe default implementation accepts a hash or hash reference of named parameters.  If it\nreceives a single argument that isn't a hash reference it will throw an error.\n\nYou can override this method in your class to handle other types of options passed to the\nconstructor.\n\nThis method should always return a hash reference of named options.\n\nFOREIGNBUILDARGS\nsub FOREIGNBUILDARGS {\nmy ( $class, $options ) = @;\nreturn $options->{foo};\n}\n\nIf you are inheriting from a non-Moo class, the arguments passed to the parent class\nconstructor can be manipulated by defining a \"FOREIGNBUILDARGS\" method.  It will receive the\nsame arguments as \"BUILDARGS\", and should return a list of arguments to pass to the parent\nclass constructor.\n\nBUILD\nsub BUILD {\nmy ($self, $args) = @;\ndie \"foo and bar cannot be used at the same time\"\nif exists $args->{foo} && exists $args->{bar};\n}\n\nOn object creation, any \"BUILD\" methods in the class's inheritance hierarchy will be called\non the object and given the results of \"BUILDARGS\".  They each will be called in order from\nthe parent classes down to the child, and thus should not themselves call the parent's\nmethod.  Typically this is used for object validation or possibly logging.\n\nDEMOLISH\nsub DEMOLISH {\nmy ($self, $inglobaldestruction) = @;\n...\n}\n\nWhen an object is destroyed, any \"DEMOLISH\" methods in the inheritance hierarchy will be\ncalled on the object.  They are given boolean to inform them if global destruction is in\nprogress, and are called from the child class upwards to the parent.  This is similar to\n\"BUILD\" methods but in the opposite order.\n\nNote that this is implemented by a \"DESTROY\" method, which is only created on on the first\nconstruction of an object of your class.  This saves on overhead for classes that are never\ninstantiated or those without \"DEMOLISH\" methods.  If you try to define your own \"DESTROY\",\nthis will cause undefined results.\n",
                "subsections": []
            },
            "IMPORTED SUBROUTINES": {
                "content": "",
                "subsections": [
                    {
                        "name": "extends",
                        "content": "extends 'Parent::Class';\n\nDeclares a base class. Multiple superclasses can be passed for multiple inheritance but\nplease consider using roles instead.  The class will be loaded but no errors will be\ntriggered if the class can't be found and there are already subs in the class.\n\nCalling extends more than once will REPLACE your superclasses, not add to them like 'use\nbase' would.\n"
                    },
                    {
                        "name": "with",
                        "content": "with 'Some::Role1';\n\nor\n\nwith 'Some::Role1', 'Some::Role2';\n\nComposes one or more Moo::Role (or Role::Tiny) roles into the current class.  An error will\nbe raised if these roles cannot be composed because they have conflicting method definitions.\nThe roles will be loaded using the same mechanism as \"extends\" uses.\n"
                    },
                    {
                        "name": "has",
                        "content": "has attr => (\nis => 'ro',\n);\n\nDeclares an attribute for the class.\n\npackage Foo;\nuse Moo;\nhas 'attr' => (\nis => 'ro'\n);\n\npackage Bar;\nuse Moo;\nextends 'Foo';\nhas '+attr' => (\ndefault => sub { \"blah\" },\n);\n\nUsing the \"+\" notation, it's possible to override an attribute.\n\nhas [qw(attr1 attr2 attr3)] => (\nis => 'ro',\n);\n\nUsing an arrayref with multiple attribute names, it's possible to declare multiple attributes\nwith the same options.\n\nThe options for \"has\" are as follows:\n\n\"is\"\nrequired, may be \"ro\", \"lazy\", \"rwp\" or \"rw\".\n\n\"ro\" stands for \"read-only\" and generates an accessor that dies if you attempt to write to\nit - i.e.  a getter only - by defaulting \"reader\" to the name of the attribute.\n\n\"lazy\" generates a reader like \"ro\", but also sets \"lazy\" to 1 and \"builder\" to\n\"build${attributename}\" to allow on-demand generated attributes.  This feature was my\nattempt to fix my incompetence when originally designing \"lazybuild\", and is also\nimplemented by MooseX::AttributeShortcuts. There is, however, nothing to stop you using\n\"lazy\" and \"builder\" yourself with \"rwp\" or \"rw\" - it's just that this isn't generally a\ngood idea so we don't provide a shortcut for it.\n\n\"rwp\" stands for \"read-write protected\" and generates a reader like \"ro\", but also sets\n\"writer\" to \"set${attributename}\" for attributes that are designed to be written from\ninside of the class, but read-only from outside.  This feature comes from\nMooseX::AttributeShortcuts.\n\n\"rw\" stands for \"read-write\" and generates a normal getter/setter by defaulting the\n\"accessor\" to the name of the attribute specified.\n\n\"isa\"\nTakes a coderef which is used to validate the attribute.  Unlike Moose, Moo does not\ninclude a basic type system, so instead of doing \"isa => 'Num'\", one should do\n\nuse Scalar::Util qw(lookslikenumber);\n...\nisa => sub {\ndie \"$[0] is not a number!\" unless lookslikenumber $[0]\n},\n\nNote that the return value for \"isa\" is discarded. Only if the sub dies does type\nvalidation fail.\n\nSub::Quote aware\n\nSince Moo does not run the \"isa\" check before \"coerce\" if a coercion subroutine has been\nsupplied, \"isa\" checks are not structural to your code and can, if desired, be omitted on\nnon-debug builds (although if this results in an uncaught bug causing your program to\nbreak, the Moo authors guarantee nothing except that you get to keep both halves).\n\nIf you want Moose compatible or MooseX::Types style named types, look at Type::Tiny.\n\nTo cause your \"isa\" entries to be automatically mapped to named Moose::Meta::TypeConstraint\nobjects (rather than the default behaviour of creating an anonymous type), set:\n\n$Moo::HandleMoose::TYPEMAP{$isacoderef} = sub {\nrequire MooseX::Types::Something;\nreturn MooseX::Types::Something::TypeName();\n};\n\nNote that this example is purely illustrative; anything that returns a\nMoose::Meta::TypeConstraint object or something similar enough to it to make Moose happy is\nfine.\n\n\"coerce\"\nTakes a coderef which is meant to coerce the attribute.  The basic idea is to do something\nlike the following:\n\ncoerce => sub {\n$[0] % 2 ? $[0] : $[0] + 1\n},\n\nNote that Moo will always execute your coercion: this is to permit \"isa\" entries to be used\npurely for bug trapping, whereas coercions are always structural to your code. We do,\nhowever, apply any supplied \"isa\" check after the coercion has run to ensure that it\nreturned a valid value.\n\nSub::Quote aware\n\nIf the \"isa\" option is a blessed object providing a \"coerce\" or \"coercion\" method, then the\n\"coerce\" option may be set to just 1.\n\n\"handles\"\nTakes a string\n\nhandles => 'RobotRole'\n\nWhere \"RobotRole\" is a role that defines an interface which becomes the list of methods to\nhandle.\n\nTakes a list of methods\n\nhandles => [ qw( one two ) ]\n\nTakes a hashref\n\nhandles => {\nun => 'one',\n}\n\n\"trigger\"\nTakes a coderef which will get called any time the attribute is set. This includes the\nconstructor, but not default or built values. The coderef will be invoked against the\nobject with the new value as an argument.\n\nIf you set this to just 1, it generates a trigger which calls the \"trigger${attrname}\"\nmethod on $self. This feature comes from MooseX::AttributeShortcuts.\n\nNote that Moose also passes the old value, if any; this feature is not yet supported.\n\nSub::Quote aware\n\n\"default\"\nTakes a coderef which will get called with $self as its only argument to populate an\nattribute if no value for that attribute was supplied to the constructor. Alternatively, if\nthe attribute is lazy, \"default\" executes when the attribute is first retrieved if no value\nhas yet been provided.\n\nIf a simple scalar is provided, it will be inlined as a string. Any non-code reference\n(hash, array) will result in an error - for that case instead use a code reference that\nreturns the desired value.\n\nNote that if your default is fired during new() there is no guarantee that other attributes\nhave been populated yet so you should not rely on their existence.\n\nSub::Quote aware\n\n\"predicate\"\nTakes a method name which will return true if an attribute has a value.\n\nIf you set this to just 1, the predicate is automatically named \"has${attrname}\" if your\nattribute's name does not start with an underscore, or\n\"has${attrnamewithouttheunderscore}\" if it does.  This feature comes from\nMooseX::AttributeShortcuts.\n\n\"builder\"\nTakes a method name which will be called to create the attribute - functions exactly like\ndefault except that instead of calling\n\n$default->($self);\n\nMoo will call\n\n$self->$builder;\n\nThe following features come from MooseX::AttributeShortcuts:\n\nIf you set this to just 1, the builder is automatically named \"build${attrname}\".\n\nIf you set this to a coderef or code-convertible object, that variable will be installed\nunder \"$class::build${attrname}\" and the builder set to the same name.\n\n\"clearer\"\nTakes a method name which will clear the attribute.\n\nIf you set this to just 1, the clearer is automatically named \"clear${attrname}\" if your\nattribute's name does not start with an underscore, or\n\"clear${attrnamewithouttheunderscore}\" if it does.  This feature comes from\nMooseX::AttributeShortcuts.\n\nNOTE: If the attribute is \"lazy\", it will be regenerated from \"default\" or \"builder\" the\nnext time it is accessed. If it is not lazy, it will be \"undef\".\n\n\"lazy\"\nBoolean.  Set this if you want values for the attribute to be grabbed lazily.  This is\nusually a good idea if you have a \"builder\" which requires another attribute to be set.\n\n\"required\"\nBoolean.  Set this if the attribute must be passed on object instantiation.\n\n\"reader\"\nThe name of the method that returns the value of the attribute.  If you like Java style\nmethods, you might set this to \"getfoo\"\n\n\"writer\"\nThe value of this attribute will be the name of the method to set the value of the\nattribute.  If you like Java style methods, you might set this to \"setfoo\".\n\n\"weakref\"\nBoolean.  Set this if you want the reference that the attribute contains to be weakened.\nUse this when circular references, which cause memory leaks, are possible.\n\n\"initarg\"\nTakes the name of the key to look for at instantiation time of the object.  A common use of\nthis is to make an underscored attribute have a non-underscored initialization name.\n\"undef\" means that passing the value in on instantiation is ignored.\n\n\"moosify\"\nTakes either a coderef or array of coderefs which is meant to transform the given\nattributes specifications if necessary when upgrading to a Moose role or class. You\nshouldn't need this by default, but is provided as a means of possible extensibility.\n"
                    },
                    {
                        "name": "before",
                        "content": "before foo => sub { ... };\n\nSee \"before method(s) => sub { ... };\" in Class::Method::Modifiers for full documentation.\n"
                    },
                    {
                        "name": "around",
                        "content": "around foo => sub { ... };\n\nSee \"around method(s) => sub { ... };\" in Class::Method::Modifiers for full documentation.\n"
                    },
                    {
                        "name": "after",
                        "content": "after foo => sub { ... };\n\nSee \"after method(s) => sub { ... };\" in Class::Method::Modifiers for full documentation.\n"
                    }
                ]
            },
            "SUB QUOTE AWARE": {
                "content": "\"quotesub\" in Sub::Quote allows us to create coderefs that are \"inlineable,\" giving us a\nhandy, XS-free speed boost.  Any option that is Sub::Quote aware can take advantage of this.\n\nTo do this, you can write\n\nuse Sub::Quote;\n\nuse Moo;\nuse namespace::clean;\n\nhas foo => (\nis => 'ro',\nisa => quotesub(q{ die \"Not <3\" unless $[0] < 3 })\n);\n\nwhich will be inlined as\n\ndo {\nlocal @ = ($[0]->{foo});\ndie \"Not <3\" unless $[0] < 3;\n}\n\nor to avoid localizing @,\n\nhas foo => (\nis => 'ro',\nisa => quotesub(q{ my ($val) = @; die \"Not <3\" unless $val < 3 })\n);\n\nwhich will be inlined as\n\ndo {\nmy ($val) = ($[0]->{foo});\ndie \"Not <3\" unless $val < 3;\n}\n\nSee Sub::Quote for more information, including how to pass lexical captures that will also be\ncompiled into the subroutine.\n",
                "subsections": []
            },
            "CLEANING UP IMPORTS": {
                "content": "Moo will not clean up imported subroutines for you; you will have to do that manually. The\nrecommended way to do this is to declare your imports first, then \"use Moo\", then \"use\nnamespace::clean\".  Anything imported before namespace::clean will be scrubbed.  Anything\nimported or declared after will be still be available.\n\npackage Record;\n\nuse Digest::MD5 qw(md5hex);\n\nuse Moo;\nuse namespace::clean;\n\nhas name => (is => 'ro', required => 1);\nhas id => (is => 'lazy');\nsub buildid {\nmy ($self) = @;\nreturn md5hex($self->name);\n}\n\n1;\n\nFor example if you were to import these subroutines after namespace::clean like this\n\nuse namespace::clean;\n\nuse Digest::MD5 qw(md5hex);\nuse Moo;\n\nthen any \"Record\" $r would have methods such as \"$r->md5hex()\", \"$r->has()\" and\n\"$r->around()\" - almost certainly not what you intend!\n\nMoo::Roles behave slightly differently.  Since their methods are composed into the consuming\nclass, they can do a little more for you automatically.  As long as you declare your imports\nbefore calling \"use Moo::Role\", those imports and the ones Moo::Role itself provides will not\nbe composed into consuming classes so there's usually no need to use namespace::clean.\n\nOn namespace::autoclean: Older versions of namespace::autoclean would inflate Moo classes to\nfull Moose classes, losing the benefits of Moo.  If you want to use namespace::autoclean with\na Moo class, make sure you are using version 0.16 or newer.\n",
                "subsections": []
            },
            "INCOMPATIBILITIES WITH MOOSE": {
                "content": "TYPES\nThere is no built-in type system.  \"isa\" is verified with a coderef; if you need complex\ntypes, Type::Tiny can provide types, type libraries, and will work seamlessly with both Moo\nand Moose.  Type::Tiny can be considered the successor to MooseX::Types and provides a\nsimilar API, so that you can write\n\nuse Types::Standard qw(Int);\nhas daystolive => (is => 'ro', isa => Int);\n\nAPI INCOMPATIBILITIES\n\"initializer\" is not supported in core since the author considers it to be a bad idea and\nMoose best practices recommend avoiding it. Meanwhile \"trigger\" or \"coerce\" are more likely\nto be able to fulfill your needs.\n\nNo support for \"super\", \"override\", \"inner\", or \"augment\" - the author considers augment to\nbe a bad idea, and override can be translated:\n\noverride foo => sub {\n...\nsuper();\n...\n};\n\naround foo => sub {\nmy ($orig, $self) = (shift, shift);\n...\n$self->$orig(@);\n...\n};\n\nThe \"dump\" method is not provided by default. The author suggests loading Devel::Dwarn into\n\"main::\" (via \"perl -MDevel::Dwarn ...\" for example) and using \"$obj->$::Dwarn()\" instead.\n\n\"default\" only supports coderefs and plain scalars, because passing a hash or array reference\nas a default is almost always incorrect since the value is then shared between all objects\nusing that default.\n\n\"lazybuild\" is not supported; you are instead encouraged to use the \"is => 'lazy'\" option\nsupported by Moo and MooseX::AttributeShortcuts.\n\n\"autoderef\" is not supported since the author considers it a bad idea and it has been\nconsidered best practice to avoid it for some time.\n\n\"documentation\" will show up in a Moose metaclass created from your class but is otherwise\nignored. Then again, Moose ignores it as well, so this is arguably not an incompatibility.\n\nSince \"coerce\" does not require \"isa\" to be defined but Moose does require it, the metaclass\ninflation for coerce alone is a trifle insane and if you attempt to subtype the result will\nalmost certainly break.\n\nHandling of warnings: when you \"use Moo\" we enable strict and warnings, in a similar way to\nMoose. The authors recommend the use of \"strictures\", which enables FATAL warnings, and\nseveral extra pragmas when used in development: indirect, multidimensional, and\nbareword::filehandles.\n\nAdditionally, Moo supports a set of attribute option shortcuts intended to reduce common\nboilerplate.  The set of shortcuts is the same as in the Moose module\nMooseX::AttributeShortcuts as of its version 0.009+.  So if you:\n\npackage MyClass;\nuse Moo;\nuse strictures 2;\n\nThe nearest Moose invocation would be:\n\npackage MyClass;\n\nuse Moose;\nuse warnings FATAL => \"all\";\nuse MooseX::AttributeShortcuts;\n\nor, if you're inheriting from a non-Moose class,\n\npackage MyClass;\n\nuse Moose;\nuse MooseX::NonMoose;\nuse warnings FATAL => \"all\";\nuse MooseX::AttributeShortcuts;\n\nMETA OBJECT\nThere is no meta object.  If you need this level of complexity you need Moose - Moo is small\nbecause it explicitly does not provide a metaprotocol.  However, if you load Moose, then\n\nClass::MOP::classof($mooclassorrole)\n\nwill return an appropriate metaclass pre-populated by Moo.\n\nIMMUTABILITY\nFinally, Moose requires you to call\n\nPACKAGE->meta->makeimmutable;\n\nat the end of your class to get an inlined (i.e. not horribly slow) constructor. Moo does it\nautomatically the first time ->new is called on your class. (\"makeimmutable\" is a no-op in\nMoo to ease migration.)\n\nAn extension MooX::late exists to ease translating Moose packages to Moo by providing a more\nMoose-like interface.\n",
                "subsections": []
            },
            "COMPATIBILITY WITH OLDER PERL VERSIONS": {
                "content": "Moo is compatible with perl versions back to 5.6.  When running on older versions, additional\nprerequisites will be required.  If you are packaging a script with its dependencies, such as\nwith App::FatPacker, you will need to be certain that the extra prerequisites are included.\n\nMRO::Compat\nRequired on perl versions prior to 5.10.0.\n\nDevel::GlobalDestruction\nRequired on perl versions prior to 5.14.0.\n",
                "subsections": []
            },
            "SUPPORT": {
                "content": "IRC: #moose on irc.perl.org\n\nBugtracker: <https://rt.cpan.org/Public/Dist/Display.html?Name=Moo>\n\nGit repository: <git://github.com/moose/Moo.git>\n\nGit browser: <https://github.com/moose/Moo>\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "mst - Matt S. Trout (cpan:MSTROUT) <mst@shadowcat.co.uk>\n",
                "subsections": []
            },
            "CONTRIBUTORS": {
                "content": "dg - David Leadbeater (cpan:DGL) <dgl@dgl.cx>\n\nfrew - Arthur Axel \"fREW\" Schmidt (cpan:FREW) <frioux@gmail.com>\n\nhobbs - Andrew Rodland (cpan:ARODLAND) <arodland@cpan.org>\n\njnap - John Napiorkowski (cpan:JJNAPIORK) <jjn1056@yahoo.com>\n\nribasushi - Peter Rabbitson (cpan:RIBASUSHI) <ribasushi@cpan.org>\n\nchip - Chip Salzenberg (cpan:CHIPS) <chip@pobox.com>\n\najgb - Alex J. G. Burzyński (cpan:AJGB) <ajgb@cpan.org>\n\ndoy - Jesse Luehrs (cpan:DOY) <doy at tozt dot net>\n\nperigrin - Chris Prather (cpan:PERIGRIN) <chris@prather.org>\n\nMithaldu - Christian Walde (cpan:MITHALDU) <walde.christian@googlemail.com>\n\nilmari - Dagfinn Ilmari Mannsåker (cpan:ILMARI) <ilmari@ilmari.org>\n\ntobyink - Toby Inkster (cpan:TOBYINK) <tobyink@cpan.org>\n\nhaarg - Graham Knop (cpan:HAARG) <haarg@cpan.org>\n\nmattp - Matt Phillips (cpan:MATTP) <mattp@cpan.org>\n\nbluefeet - Aran Deltac (cpan:BLUEFEET) <bluefeet@gmail.com>\n\nbubaflub - Bob Kuo (cpan:BUBAFLUB) <bubaflub@cpan.org>\n\nether = Karen Etheridge (cpan:ETHER) <ether@cpan.org>\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright (c) 2010-2015 the Moo \"AUTHOR\" and \"CONTRIBUTORS\" as listed above.\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "This library is free software and may be distributed under the same terms as perl itself. See\n<https://dev.perl.org/licenses/>.\n\n\n\nperl v5.32.1                                 2021-12-05                                     Moo(3pm)",
                "subsections": []
            }
        }
    }
}