X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FClass%2FMOP%2FMethod%2FAccessor.pm;h=d4c7de6e9c950ffe4d89c17ac84accffac37162c;hb=0bfc85b88523ddd75e0868d6ec1244f4365bda07;hp=f882ae5d943b059d2668103d72bb853037730af9;hpb=26ffbb36c3741396b796f1049a86b87cb8319c0d;p=gitmo%2FClass-MOP.git diff --git a/lib/Class/MOP/Method/Accessor.pm b/lib/Class/MOP/Method/Accessor.pm index f882ae5..d4c7de6 100644 --- a/lib/Class/MOP/Method/Accessor.pm +++ b/lib/Class/MOP/Method/Accessor.pm @@ -28,7 +28,7 @@ sub new { ($options{package_name} && $options{name}) || confess "You must supply the package_name and name parameters $Class::MOP::Method::UPGRADE_ERROR_TEXT"; - my $self = $class->_new(%options); + my $self = $class->_new(\%options); # we don't want this creating # a cycle in the code, if not @@ -41,11 +41,12 @@ sub new { } sub _new { - my ( $class, %options ) = @_; + my $class = shift; + my $options = @_ == 1 ? $_[0] : {@_}; - $options{is_inline} ||= 0; + $options->{is_inline} ||= 0; - return bless \%options, $class; + return bless $options, $class; } ## accessors