# phpman > perldoc > Moose::Cookbook::Snack::Keywords

## NAME
    [Moose::Cookbook::Snack::Keywords](https://www.chedong.com/phpMan.php/perldoc/Moose%3A%3ACookbook%3A%3ASnack%3A%3AKeywords/markdown) - Restricted "keywords" in Moose

## VERSION
    version 2.2200

## DESCRIPTION
    Moose exports a number of sugar functions in order to emulate Perl built-in keywords. These can
    cause clashes with other user-defined functions. This document provides a list of those keywords
    for easy reference.

### The 'meta' keyword
    "use Moose" adds a method called "meta" 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 "-meta_name" option when you "use Moose". 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;

### Moose Keywords
    If you are using Moose or [Moose::Role](https://www.chedong.com/phpMan.php/perldoc/Moose%3A%3ARole/markdown) it is best to avoid these keywords:

    extends
    with
    has
    before
    after
    around
    super
    override
    inner
    augment
    confess
    blessed
    meta

### [Moose::Util::TypeConstraints](https://www.chedong.com/phpMan.php/perldoc/Moose%3A%3AUtil%3A%3ATypeConstraints/markdown) Keywords
    If you are using [Moose::Util::TypeConstraints](https://www.chedong.com/phpMan.php/perldoc/Moose%3A%3AUtil%3A%3ATypeConstraints/markdown) it is best to avoid these keywords:

    type
    subtype
    class_type
    role_type
    maybe_type
    duck_type
    as
    where
    message
    inline_as
    coerce
    from
    via
    enum
    find_type_constraint
    register_type_constraint

### Avoiding collisions
   Turning off Moose
    To remove the sugar functions Moose exports, just add "no Moose" at the bottom of your code:

      package Thing;
      use Moose;

      # code here

      no Moose;

    This will unexport the sugar functions that Moose originally exported. The same will also work
    for [Moose::Role](https://www.chedong.com/phpMan.php/perldoc/Moose%3A%3ARole/markdown) and [Moose::Util::TypeConstraints](https://www.chedong.com/phpMan.php/perldoc/Moose%3A%3AUtil%3A%3ATypeConstraints/markdown).

   [Sub::Exporter](https://www.chedong.com/phpMan.php/perldoc/Sub%3A%3AExporter/markdown) features
    Moose, [Moose::Role](https://www.chedong.com/phpMan.php/perldoc/Moose%3A%3ARole/markdown) and [Moose::Util::TypeConstraints](https://www.chedong.com/phpMan.php/perldoc/Moose%3A%3AUtil%3A%3ATypeConstraints/markdown) all use [Sub::Exporter](https://www.chedong.com/phpMan.php/perldoc/Sub%3A%3AExporter/markdown) to handle all their
    exporting needs. This means that all the features that [Sub::Exporter](https://www.chedong.com/phpMan.php/perldoc/Sub%3A%3AExporter/markdown) provides are also available
    to them.

    For instance, with [Sub::Exporter](https://www.chedong.com/phpMan.php/perldoc/Sub%3A%3AExporter/markdown) you can rename keywords, like so:

      package [LOL::Cat](https://www.chedong.com/phpMan.php/perldoc/LOL%3A%3ACat/markdown);
      use Moose 'has' => { -as => 'i_can_haz' };

      i_can_haz 'cheeseburger' => (
          is      => 'rw',
          trigger => sub { print "NOM NOM" }
      );

      [LOL::Cat](https://www.chedong.com/phpMan.php/perldoc/LOL%3A%3ACat/markdown)->new->cheeseburger('KTHNXBYE');

    See the [Sub::Exporter](https://www.chedong.com/phpMan.php/perldoc/Sub%3A%3AExporter/markdown) docs for more information.

   [namespace::autoclean](https://www.chedong.com/phpMan.php/perldoc/namespace%3A%3Aautoclean/markdown) and [namespace::clean](https://www.chedong.com/phpMan.php/perldoc/namespace%3A%3Aclean/markdown)
    You can also use [namespace::autoclean](https://www.chedong.com/phpMan.php/perldoc/namespace%3A%3Aautoclean/markdown) 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 overload, due to internal implementation details), it will remove
    these as well.

    Another option is to use [namespace::clean](https://www.chedong.com/phpMan.php/perldoc/namespace%3A%3Aclean/markdown) directly, but you must be careful not to remove "meta"
    when doing so:

      package Foo;
      use Moose;
      use [namespace::clean](https://www.chedong.com/phpMan.php/perldoc/namespace%3A%3Aclean/markdown) -except => 'meta';
      # ...

## SEE ALSO
    Moose
    [Moose::Role](https://www.chedong.com/phpMan.php/perldoc/Moose%3A%3ARole/markdown)
    [Moose::Util::TypeConstraints](https://www.chedong.com/phpMan.php/perldoc/Moose%3A%3AUtil%3A%3ATypeConstraints/markdown)
    [Sub::Exporter](https://www.chedong.com/phpMan.php/perldoc/Sub%3A%3AExporter/markdown)
    [namespace::autoclean](https://www.chedong.com/phpMan.php/perldoc/namespace%3A%3Aautoclean/markdown)
    [namespace::clean](https://www.chedong.com/phpMan.php/perldoc/namespace%3A%3Aclean/markdown)

## AUTHORS
    *   Stevan Little <<stevan@cpan.org>>

    *   Dave Rolsky <<autarch@urth.org>>

    *   Jesse Luehrs <<doy@cpan.org>>

    *   Shawn M Moore <<sartak@cpan.org>>

    *   יובל קוג'מן (Yuval Kogman) <<nothingmuch@woobling.org>>

    *   Karen Etheridge <<ether@cpan.org>>

    *   Florian Ragwitz <<rafl@debian.org>>

    *   Hans Dieter Pearcey <<hdp@cpan.org>>

    *   Chris Prather <<chris@prather.org>>

    *   Matt S Trout <<mstrout@cpan.org>>

## COPYRIGHT AND LICENSE
    This software is copyright (c) 2006 by Infinity Interactive, Inc.

    This is free software; you can redistribute it and/or modify it under the same terms as the Perl
    5 programming language system itself.

