X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FManual%2FClasses.pod;h=8962c9756c5a02b71ff28a6d6c23cbd675c5221b;hb=d5f016af3d56eec870efee8858352a4014879be2;hp=7183de9c9c1a368cc0e4fac6af3f30e4eb878030;hpb=dab940632264ba728cdd882436a2c972f001fecf;p=gitmo%2FMoose.git diff --git a/lib/Moose/Manual/Classes.pod b/lib/Moose/Manual/Classes.pod index 7183de9..8962c97 100644 --- a/lib/Moose/Manual/Classes.pod +++ b/lib/Moose/Manual/Classes.pod @@ -83,16 +83,28 @@ namespace. We recommend that you take advantage of this feature, since it just makes your classes "cleaner". You can do this by simply adding C at the end of your module file. + package Person; + + use Moose; + + has 'ssn' => ( is => 'rw' ); + + no Moose; + This deletes Moose's sugar functions from your class's namespace, so that C<< Person->can('has') >> will no longer return true. +A more generic way to unimport not only L's exports but also +those from type libraries and other modules is to use +L or L. + =head1 MAKING IT FASTER Moose has a feature called "immutabilization" that you can use to greatly speed up your classes at runtime. However, using it does incur a cost when your class is first being loaded. When you make your class immutable you tell Moose that you will not be changing it in the -future. You will not adding any more attributes, methods, roles, etc. +future. You will not be adding any more attributes, methods, roles, etc. This allows Moose to generate code specific to your class. In particular, it creates an "inline" constructor, making object