Add built local::lib
[catagits/Gitalist.git] / local-lib5 / man / man3 / Moose::Manual.3pm
diff --git a/local-lib5/man/man3/Moose::Manual.3pm b/local-lib5/man/man3/Moose::Manual.3pm
new file mode 100644 (file)
index 0000000..0f92895
--- /dev/null
@@ -0,0 +1,388 @@
+.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings.  \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote.  | will give a
+.\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
+.\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
+.\" expand to `' in nroff, nothing in troff, for use with C<>.
+.tr \(*W-|\(bv\*(Tr
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+.    ds -- \(*W-
+.    ds PI pi
+.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
+.    ds L" ""
+.    ds R" ""
+.    ds C` ""
+.    ds C' ""
+'br\}
+.el\{\
+.    ds -- \|\(em\|
+.    ds PI \(*p
+.    ds L" ``
+.    ds R" ''
+'br\}
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD.  Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.if \nF \{\
+.    de IX
+.    tm Index:\\$1\t\\n%\t"\\$2"
+..
+.    nr % 0
+.    rr F
+.\}
+.\"
+.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.hy 0
+.if n .na
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
+.    \" fudge factors for nroff and troff
+.if n \{\
+.    ds #H 0
+.    ds #V .8m
+.    ds #F .3m
+.    ds #[ \f1
+.    ds #] \fP
+.\}
+.if t \{\
+.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+.    ds #V .6m
+.    ds #F 0
+.    ds #[ \&
+.    ds #] \&
+.\}
+.    \" simple accents for nroff and troff
+.if n \{\
+.    ds ' \&
+.    ds ` \&
+.    ds ^ \&
+.    ds , \&
+.    ds ~ ~
+.    ds /
+.\}
+.if t \{\
+.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+.    \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+.    \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+.    \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+.    ds : e
+.    ds 8 ss
+.    ds o a
+.    ds d- d\h'-1'\(ga
+.    ds D- D\h'-1'\(hy
+.    ds th \o'bp'
+.    ds Th \o'LP'
+.    ds ae ae
+.    ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "Moose::Manual 3"
+.TH Moose::Manual 3 "2009-07-13" "perl v5.8.7" "User Contributed Perl Documentation"
+.SH "NAME"
+Moose::Manual \- What is Moose, and how do I use it?
+.SH "WHAT IS MOOSE?"
+.IX Header "WHAT IS MOOSE?"
+Moose is a \fIcomplete\fR object system for Perl 5. Consider any modern
+object-oriented language (which Perl 5 definitely isn't). It provides
+keywords for attribute declaration, object construction, inheritance,
+and maybe more. These keywords are part of the language, and you don't
+care how they are implemented.
+.PP
+Moose aims to do the same thing for Perl 5 \s-1OO\s0. We can't actually
+create new keywords, but we do offer \*(L"sugar\*(R" that looks a lot like
+them. More importantly, with Moose, you \fIdefine your class
+declaratively\fR, without needing to know about blessed hashrefs,
+accessor methods, and so on.
+.PP
+With Moose, you can concentrate on the \fIlogical\fR structure of your
+classes, focusing on \*(L"what\*(R" rather than \*(L"how\*(R". A class definition with
+Moose reads like a list of very concise English sentences.
+.PP
+Moose is built on top of \f(CW\*(C`Class::MOP\*(C'\fR, a meta-object protocol (aka
+\&\s-1MOP\s0). Using the \s-1MOP\s0, Moose provides complete introspection for all
+Moose-using classes. This means you can ask classes about their
+attributes, parents, children, methods, etc., all using a well-defined
+\&\s-1API\s0. The \s-1MOP\s0 abstracts away the symbol table, looking at \f(CW@ISA\fR vars,
+and all the other crufty Perl tricks we know and love(?).
+.PP
+Moose is based in large part on the Perl 6 object system, as well as
+drawing on the best ideas from \s-1CLOS\s0, Smalltalk, and many other
+languages.
+.SH "WHY MOOSE?"
+.IX Header "WHY MOOSE?"
+Moose makes Perl 5 \s-1OO\s0 both simpler and more powerful. It encapsulates
+Perl 5 power tools in high-level declarative APIs which are easy to
+use. Best of all, you don't need to be a wizard to use it.
+.PP
+But if you want to dig about in the guts, Moose lets you do that too,
+by using and extending its powerful introspection \s-1API\s0.
+.SH "AN EXAMPLE"
+.IX Header "AN EXAMPLE"
+.Vb 1
+\&  package Person;
+.Ve
+.PP
+.Vb 1
+\&  use Moose;
+.Ve
+.PP
+.Vb 4
+\&  has 'first_name' => (
+\&      is  => 'rw',
+\&      isa => 'Str',
+\&  );
+.Ve
+.PP
+.Vb 4
+\&  has 'last_name' => (
+\&      is  => 'rw',
+\&      isa => 'Str',
+\&  );
+.Ve
+.PP
+.Vb 2
+\&  no Moose;
+\&  __PACKAGE__\->meta\->make_immutable;
+.Ve
+.PP
+This is a \fIcomplete and usable\fR class definition!
+.PP
+.Vb 1
+\&  package User;
+.Ve
+.PP
+.Vb 2
+\&  use DateTime;
+\&  use Moose;
+.Ve
+.PP
+.Vb 1
+\&  extends 'Person';
+.Ve
+.PP
+.Vb 4
+\&  has 'password' => (
+\&      is  => 'rw',
+\&      isa => 'Str',
+\&  );
+.Ve
+.PP
+.Vb 5
+\&  has 'last_login' => (
+\&      is      => 'rw',
+\&      isa     => 'DateTime',
+\&      handles => { 'date_of_last_login' => 'date' },
+\&  );
+.Ve
+.PP
+.Vb 3
+\&  sub login {
+\&      my $self = shift;
+\&      my $pw   = shift;
+.Ve
+.PP
+.Vb 1
+\&      return 0 if $pw ne $self\->password;
+.Ve
+.PP
+.Vb 1
+\&      $self\->last_login( DateTime\->now() );
+.Ve
+.PP
+.Vb 2
+\&      return 1;
+\&  }
+.Ve
+.PP
+.Vb 2
+\&  no Moose;
+\&  __PACKAGE__\->meta\->make_immutable;
+.Ve
+.PP
+We'll leave the line-by-line explanation of this code to other
+documentation, but you can see how Moose reduces common \s-1OO\s0 idioms to
+simple declarative constructs.
+.SH "TABLE OF CONTENTS"
+.IX Header "TABLE OF CONTENTS"
+This manual consists of a number of documents.
+.IP "Moose::Manual::Concepts" 4
+.IX Item "Moose::Manual::Concepts"
+Introduces Moose concepts, and contrasts them against \*(L"old school\*(R"
+Perl 5 \s-1OO\s0.
+.IP "Moose::Manual::Unsweetened" 4
+.IX Item "Moose::Manual::Unsweetened"
+Shows two example classes, each written first with Moose and then with
+\&\*(L"plain old Perl 5\*(R".
+.IP "Moose::Manual::Classes" 4
+.IX Item "Moose::Manual::Classes"
+How do you make use of Moose in your classes? Now that I'm a Moose,
+how do I subclass something?
+.IP "Moose::Manual::Attributes" 4
+.IX Item "Moose::Manual::Attributes"
+Attributes are a core part of the Moose \s-1OO\s0 system. An attribute is a
+piece of data that an object has. Moose has a lot of attribute-related
+features!
+.IP "Moose::Manual::Delegation" 4
+.IX Item "Moose::Manual::Delegation"
+Delegation is a powerful way to make use of attributes which are
+themselves objects.
+.IP "Moose::Manual::Construction" 4
+.IX Item "Moose::Manual::Construction"
+Learn how objects are built in Moose, and in particular about the
+\&\f(CW\*(C`BUILD\*(C'\fR and \f(CW\*(C`BUILDARGS\*(C'\fR methods. Also covers object destruction
+with \f(CW\*(C`DEMOLISH\*(C'\fR.
+.IP "Moose::Manual::MethodModifiers" 4
+.IX Item "Moose::Manual::MethodModifiers"
+A method modifier lets you say \*(L"before calling method X, do this
+first\*(R", or \*(L"wrap method X in this code\*(R". Method modifiers are
+particularly handy in roles and with attribute accessors.
+.IP "Moose::Manual::Roles" 4
+.IX Item "Moose::Manual::Roles"
+A role is something a class does (like \*(L"Debuggable\*(R" or
+\&\*(L"Printable\*(R"). Roles provide a way of adding behavior to classes that
+is orthogonal to inheritance.
+.IP "Moose::Manual::Types" 4
+.IX Item "Moose::Manual::Types"
+Moose's type system lets you strictly define what values an attribute
+can contain.
+.IP "Moose::Manual::MOP" 4
+.IX Item "Moose::Manual::MOP"
+Moose's meta \s-1API\s0 system lets you ask classes about their parents,
+children, methods, attributes, etc.
+.IP "Moose::Manual::MooseX" 4
+.IX Item "Moose::Manual::MooseX"
+This document describes a few of the most useful Moose extensions on
+\&\s-1CPAN\s0.
+.IP "Moose::Manual::BestPractices" 4
+.IX Item "Moose::Manual::BestPractices"
+Moose has a lot of features, and there's definitely more than one way
+to do it. However, we think that picking a subset of these features
+and using them consistently makes everyone's life easier.
+.IP "Moose::Manual::FAQ" 4
+.IX Item "Moose::Manual::FAQ"
+Frequently asked questions about Moose.
+.IP "Moose::Manual::Contributing" 4
+.IX Item "Moose::Manual::Contributing"
+Interested in hacking on Moose? Read this.
+.IP "Moose::Manual::Delta" 4
+.IX Item "Moose::Manual::Delta"
+This document details backwards-incompatibilities and other major
+changes to Moose.
+.SH "JUSTIFICATION"
+.IX Header "JUSTIFICATION"
+If you're still asking yourself \*(L"Why do I need this?\*(R", then this
+section is for you.
+.IP "Another object system!?!?" 4
+.IX Item "Another object system!?!?"
+Yes, we know there are many, many ways to build objects in Perl 5,
+many of them based on inside-out objects and other such things. Moose
+is different because it is not a new object system for Perl 5, but
+instead an extension of the existing object system.
+.Sp
+Moose is built on top of Class::MOP, which is a metaclass system
+for Perl 5. This means that Moose not only makes building normal
+Perl 5 objects better, but it also provides the power of metaclass
+programming.
+.IP "Is this for real? Or is this just an experiment?" 4
+.IX Item "Is this for real? Or is this just an experiment?"
+Moose is \fIbased\fR on the prototypes and experiments Stevan did for the
+Perl 6 meta\-model. However, Moose is \fB\s-1NOT\s0\fR an experiment or
+prototype; it is for \fBreal\fR.
+.IP "Is this ready for use in production?" 4
+.IX Item "Is this ready for use in production?"
+Yes.
+.Sp
+Moose has been used successfully in production environments by many
+people and companies. There are Moose applications which have been in
+production with little or no issue now for years. We consider it
+highly stable and we are committed to keeping it stable.
+.Sp
+Of course, in the end, you need to make this call yourself. If you
+have any questions or concerns, please feel free to email Stevan or
+the moose@perl.org list, or just stop by irc.perl.org#moose and ask
+away.
+.IP "Is Moose just Perl 6 in Perl 5?" 4
+.IX Item "Is Moose just Perl 6 in Perl 5?"
+No. While Moose is very much inspired by Perl 6, it is not itself Perl
+6. Instead, it is an \s-1OO\s0 system for Perl 5. Stevan built Moose because
+he was tired of writing the same old boring Perl 5 \s-1OO\s0 code, and
+drooling over Perl 6 \s-1OO\s0. So instead of switching to Ruby, he wrote
+Moose :)
+.IP "Wait, \fIpost\fR modern, I thought it was just \fImodern\fR?" 4
+.IX Item "Wait, post modern, I thought it was just modern?"
+Stevan read Larry Wall's talk from the 1999 Linux World entitled
+\&\*(L"Perl, the first postmodern computer language\*(R" in which he talks about
+how he picked the features for Perl because he thought they were cool
+and he threw out the ones that he thought sucked. This got him
+thinking about how we have done the same thing in Moose. For Moose, we
+have \*(L"borrowed\*(R" features from Perl 6, \s-1CLOS\s0 (\s-1LISP\s0), Smalltalk, Java,
+\&\s-1BETA\s0, OCaml, Ruby and more, and the bits we didn't like (cause they
+sucked) we tossed aside. So for this reason (and a few others) Stevan
+has re-dubbed Moose a \fIpostmodern\fR object system.
+.Sp
+Nuff Said.
+.SH "AUTHORS"
+.IX Header "AUTHORS"
+Dave Rolsky <autarch@urth.org>
+.PP
+Stevan Little <stevan@iinteractive.com>
+.SH "COPYRIGHT AND LICENSE"
+.IX Header "COPYRIGHT AND LICENSE"
+Copyright 2008\-2009 by Infinity Interactive, Inc.
+.PP
+<http://www.iinteractive.com>
+.PP
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.