From: Jesse Luehrs Date: Fri, 6 May 2011 22:10:04 +0000 (-0500) Subject: fix up ::Cookbook::Snack::Keywords X-Git-Tag: 2.0003~42 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9c76cced06fb07a4ff0037f500ba646c1e6c12d1;p=gitmo%2FMoose.git fix up ::Cookbook::Snack::Keywords --- diff --git a/lib/Moose/Cookbook/Snack/Keywords.pod b/lib/Moose/Cookbook/Snack/Keywords.pod index 031a143..329ff32 100644 --- a/lib/Moose/Cookbook/Snack/Keywords.pod +++ b/lib/Moose/Cookbook/Snack/Keywords.pod @@ -15,9 +15,16 @@ reference. =head2 The 'meta' keyword -While most collisions can be avoided, you cannot avoid importing a -C method when you C>. If you try to override or -change what C does, you could end up breaking Moose internals. +C> adds a method called C to your class. If this +conflicts with a method or function you are using, you can rename it, +or prevent it from being installed entirely. To do this, pass the +C<-meta_name> option when you C>. For instance: + + # install it under a different name + use Moose -meta_name => 'moose_meta'; + + # don't install it at all + use Moose -meta_name => undef; =head2 Moose Keywords @@ -69,6 +76,8 @@ these keywords =item maybe_type +=item duck_type + =item as =item where @@ -77,6 +86,8 @@ these keywords =item optimize_as +=item inline_as + =item coerce =item from @@ -130,9 +141,15 @@ For instance, with L you can rename keywords, like so: See the L docs for more information. -=head3 namespace::clean +=head3 namespace::autoclean and namespace::clean + +You can also use L to clean up your namespace. +This will remove all imported functions from your namespace. Note +that if you are importing functions that are intended to be used as +methods (this includes L, due to internal implementation +details), it will remove these as well. -You can also use L to clean up your namespace, but +Another option is to use L directly, but you must be careful not to remove C when doing so: package Foo; @@ -152,6 +169,8 @@ you must be careful not to remove C when doing so: =item L +=item L + =item L =back