From: Jesse Luehrs <doy@tozt.net>
Date: Tue, 15 Sep 2009 06:11:28 +0000 (-0500)
Subject: don't remove the package name from @_
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b1b01528b6af3f3b179b76773883290988567ad2;p=gitmo%2FMoose.git

don't remove the package name from @_
---

diff --git a/lib/Moose/Exporter.pm b/lib/Moose/Exporter.pm
index 42a7a57..8eccfeb 100644
--- a/lib/Moose/Exporter.pm
+++ b/lib/Moose/Exporter.pm
@@ -349,7 +349,7 @@ sub _make_import_sub {
         my %extra_args;
         # don't want to just force @_ into a hash, since it really actually is
         # an array
-        for my $i (1..$#_) {
+        for my $i (1..($#_ - 1)) {
             if (grep { $_ eq $_[$i] } @$init_meta_params) {
                 $extra_args{$_[$i]} = $_[$i + 1];
                 splice @_, $i, 2;