From: Vincent Pit Date: Tue, 7 Apr 2015 16:20:25 +0000 (-0300) Subject: Also remove PP in @ARGV when PP=0 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FScalar-Vec-Util.git;a=commitdiff_plain;h=fcdbd2d7ac0ae467c4b58f1c464e1ced11f7b1a7 Also remove PP in @ARGV when PP=0 --- diff --git a/Makefile.PL b/Makefile.PL index c56d8b5..ac429aa 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -72,22 +72,21 @@ sub check_exe { return $exe; } -my ($pp, $skip_arg); +my $pp; for my $i (0 .. $#ARGV) { my $arg = $ARGV[$i]; if ($arg =~ /^PP=(.*)/) { my $val = $1; if (do { no warnings 'numeric'; int $val } or $val =~ /^(?:y|yes)$/i) { print "Forcing the pure-Perl implementation from the arguments passed to Makefile.PL.\n"; - $pp = 1; - $skip_arg = $i; + $pp = 1; last; } + $ARGV[$i] = undef; } } -if (defined $skip_arg) { - splice @ARGV, $skip_arg, 1; -} + +@ARGV = grep defined, @ARGV; my ($cc, $ld); unless ($pp) {