From: Yuval Kogman Date: Thu, 1 Oct 2009 00:59:24 +0000 (+0200) Subject: dearbitrarize X-Git-Tag: 0.95~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b89a595f03dc8d666e70e0448afc625a9213af0a;p=gitmo%2FClass-MOP.git dearbitrarize --- diff --git a/lib/Class/MOP/Package.pm b/lib/Class/MOP/Package.pm index f6d4261..3bfca1e 100644 --- a/lib/Class/MOP/Package.pm +++ b/lib/Class/MOP/Package.pm @@ -358,7 +358,8 @@ sub _code_is_mine { sub has_method { my ($self, $method_name) = @_; - (defined $method_name && $method_name) + + defined($method_name) || confess "You must define a method name"; return defined($self->get_method($method_name)); @@ -366,7 +367,8 @@ sub has_method { sub get_method { my ( $self, $method_name ) = @_; - ( defined $method_name && $method_name ) + + defined($method_name) || confess "You must define a method name"; my $method_map = $self->_method_map;