Skip to content

Instantly share code, notes, and snippets.

@berekuk
Created June 29, 2011 15:16
Show Gist options
  • Select an option

  • Save berekuk/1054056 to your computer and use it in GitHub Desktop.

Select an option

Save berekuk/1054056 to your computer and use it in GitHub Desktop.
package X;
# some non-moose abstract class
# there are lots of code using its subclasses
sub write {
die 'not implemented';
}
package X::Role::Moose;
# so I want to replace it with...
requires 'write';
around ['does', 'isa'] => sub {
my $orig = shift;
my $self = shift;
return 1 if $_[0] eq 'X';
return $self->$orig(@_);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment