Skip to content

Instantly share code, notes, and snippets.

@rsrchboy
Created April 4, 2011 02:49
Show Gist options
  • Save rsrchboy/901078 to your computer and use it in GitHub Desktop.
Save rsrchboy/901078 to your computer and use it in GitHub Desktop.

SYNOPSIS

package Foo;
use Moose;

# mark overloads as methods and wipe other non-methods
use MooseX::MarkAsMethods autoclean => 1;

# define overloads, etc as normal

package Baz;
use Moose::Role;
use MooseX::MarkAsMethods autoclean => 1;

# overloads defined in a role will "just work" when the role is
# composed into a class

use constant foo => 'bar';

# additional methods generated outside Class::MOP/Moose can be marked, too
__PACKAGE__->meta->mark_as_method('foo');

package Bar;
use Moose;

# order is important!
use namespace::autoclean;
use MooseX::MarkAsMethods;

# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment