sub inherit_from_foreign_class {
my($class, $super) = @_;
- Carp::carp("You inherit from non-Mouse class ($super),"
- . " but it is unlikely to work correctly."
- . " Please consider using MouseX::Foreign");
+ if($ENV{PERL_MOUSE_STRICT}) {
+ Carp::carp("You inherit from non-Mouse class ($super),"
+ . " but it is unlikely to work correctly."
+ . " Please consider using MouseX::Foreign");
+ }
return;
}
# then register the attribute to the metaclass
$attr->{insertion_order} = keys %{ $self->{attributes} };
$self->{attributes}{$name} = $attr;
- delete $self->{_mouse_cache}; # clears internal cache
+ $self->_invalidate_metaclass_cache();
if(!$attr->{associated_methods} && ($attr->{is} || '') ne 'bare'){
Carp::carp(qq{Attribute ($name) of class }.$self->name
local $Mouse::SUPER_PACKAGE = $package;
local $Mouse::SUPER_BODY = $super_body;
local @Mouse::SUPER_ARGS = @_;
-
- $code->(@_);
+ &{$code};
});
return;
}
my $super_package = $super->package_name;
my $super_body = $super->body;
- $self->add_method($name => sub{
+ $self->add_method($name => sub {
local $Mouse::INNER_BODY{$super_package} = $code;
local $Mouse::INNER_ARGS{$super_package} = [@_];
- $super_body->(@_);
+ &{$super_body};
});
return;
}
=head1 VERSION
-This document describes Mouse version 0.76
+This document describes Mouse version 0.93
=head1 DESCRIPTION