From: Yuval Kogman Date: Fri, 15 Aug 2008 15:35:40 +0000 (+0000) Subject: pass @_ % 2 == 1 for compat X-Git-Tag: 0_64_01~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3eda22f8489c47bff1d5b415cf23e479305f203d;p=gitmo%2FClass-MOP.git pass @_ % 2 == 1 for compat --- diff --git a/lib/Class/MOP/Package.pm b/lib/Class/MOP/Package.pm index 193934a..f4341ff 100644 --- a/lib/Class/MOP/Package.pm +++ b/lib/Class/MOP/Package.pm @@ -44,14 +44,14 @@ sub reinitialize { unshift @args, "package" if @args % 2; my %options = @args; - my $package_name = $options{package}; + my $package_name = delete $options{package}; (defined $package_name && $package_name && !blessed($package_name)) || confess "You must pass a package name and it cannot be blessed"; Class::MOP::remove_metaclass_by_name($package_name); - $class->initialize('package' => $package_name, @_); + $class->initialize($package_name, %options); # call with first arg form for compat } sub _new {