Skip to content

Instantly share code, notes, and snippets.

@domm
Created October 8, 2013 12:51
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 domm/6884191 to your computer and use it in GitHub Desktop.
Save domm/6884191 to your computer and use it in GitHub Desktop.
mop add method
use 5.18.1;
use mop;
class Foo {};
mop::meta('Foo')->add_method(mop::method->new(name=>'bar',body=>sub { say "bar"}));
my $foo = Foo->new;
$foo->bar;
@zakame
Copy link

zakame commented Oct 8, 2013

mop::meta('Foo')->FINALIZE before object creation will confirm the method meta addition

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