X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FClass%2FMOP%2FMethod%2FAccessor.pm;h=0ecdca25435be363e648033425c70e6ba1480c6d;hb=94278c1ba6283af20c09a6aef615954825d08162;hp=f882ae5d943b059d2668103d72bb853037730af9;hpb=a9e38dc76d4270c7a3d4fabae8e0e2009f11b5bb;p=gitmo%2FClass-MOP.git diff --git a/lib/Class/MOP/Method/Accessor.pm b/lib/Class/MOP/Method/Accessor.pm index f882ae5..0ecdca2 100644 --- a/lib/Class/MOP/Method/Accessor.pm +++ b/lib/Class/MOP/Method/Accessor.pm @@ -8,6 +8,7 @@ use Carp 'confess'; use Scalar::Util 'blessed', 'weaken'; our $VERSION = '0.65'; +$VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; use base 'Class::MOP::Method::Generated'; @@ -28,7 +29,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 +42,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