From: Jesse Luehrs Date: Tue, 15 Sep 2009 06:16:10 +0000 (-0500) Subject: fix an undef warning, and make the logic a little less hairy X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=02bc13385d4956f091d03d5a5b02b51483fbb53d;p=gitmo%2FMoose.git fix an undef warning, and make the logic a little less hairy --- diff --git a/lib/Moose/Exporter.pm b/lib/Moose/Exporter.pm index 8eccfeb..fd26139 100644 --- a/lib/Moose/Exporter.pm +++ b/lib/Moose/Exporter.pm @@ -349,11 +349,15 @@ 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..($#_ - 1)) { + my $i = 1; + while ($i < $#_) { if (grep { $_ eq $_[$i] } @$init_meta_params) { $extra_args{$_[$i]} = $_[$i + 1]; splice @_, $i, 2; } + else { + $i++; + } } my $did_init_meta;