my $pkg = $self->name;
no strict 'refs';
- no warnings 'redefine';
+ no warnings 'redefine', 'once';
*{ $pkg . '::' . $name } = $code;
}
defined($method_name)
or $self->throw_error('You must define a method name');
- return 1 if $self->{methods}->{$method_name};
+ return 1 if $self->{methods}{$method_name};
- my $code = do{ no strict 'refs'; *{$self->{package} . '::' . $method_name}{CODE} };
+ my $code = do{
+ no strict 'refs';
+ no warnings 'once';
+ *{ $self->{package} . '::' . $method_name }{CODE};
+ };
return $code && $self->_code_is_mine($code);
}
or $self->throw_error('You must define a method name');
return $self->{methods}{$method_name} ||= do{
- my $code = do{ no strict 'refs'; *{$self->{package} . '::' . $method_name}{CODE} };
+ my $code = do{
+ no strict 'refs';
+ no warnings 'once';
+ *{$self->{package} . '::' . $method_name}{CODE};
+ };
- $code && $self->_code_is_mine($code) && $code;
+ ($code && $self->_code_is_mine($code)) ? $code : undef;
};
}
Mouse::Meta::Module - The base class for Mouse::Meta::Class and Mouse::Meta::Role
+=head1 VERSION
+
+This document describes Mouse version 0.39
+
=head1 SEE ALSO
L<Class::MOP::Class>