Skip to content

Instantly share code, notes, and snippets.

@stevan
Created December 3, 2011 03:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevan/1425974 to your computer and use it in GitHub Desktop.
Save stevan/1425974 to your computer and use it in GitHub Desktop.
use Moose;
use Class::MOP::Attribute;
use Class::MOP::Class;
use Data::Dumper;
my $ass = Class::MOP::Class->create(
'FooBarski' => (
version => '0.01',
)
);
print Dumper($ass);
$ass->make_mutable;
print $ass->is_mutable."\n";
$ass->add_attribute(Class::MOP::Attribute->new(
foo => (
accessor => 'foo',
default => 'Hello World'
)
));
my $foo = $ass->new_object;
print $foo->foo."\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment