Skip to content

Instantly share code, notes, and snippets.

@jbarber
Last active August 29, 2015 13:58
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 jbarber/10239534 to your computer and use it in GitHub Desktop.
Save jbarber/10239534 to your computer and use it in GitHub Desktop.
Moose meta-example
use strict;
use warnings;
use Moose;
my $meta = Moose::Meta::Class->create_anon_class();
$meta->add_attribute("foo" => (is => "rw", isa => "Int"));
$meta->make_immutable;
my $object = $meta->new_object(foo => 2);
print $object->foo, "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment