It was passing an extra argument to splice, causing splice @PATH, 0, 0
to append ":0" to the environment variable.
my $length = shift;
my @temp = split($sep, $ENV{$$self});
if (wantarray) {
- my @result = splice @temp, $self, $offset, $length, @_;
+ my @result = splice @temp, $offset, $length, @_;
$ENV{$$self} = join($sep, @temp);
return @result;
} else {
use Test::More;
plan(skip_all => "skipped for VMS") if $^O eq 'VMS';
-plan(tests => 11);
+plan(tests => 12);
use Env qw(@FOO);
use vars qw(@BAR);
splice @FOO, 1, 1, 'B';
splice @BAR, 1, 1, 'B';
is_deeply(\@FOO, \@BAR, "Splice");
+
+my $foo = $ENV{FOO};
+() = splice @FOO, 0, 0;
+is $ENV{FOO}, $foo, 'Splice in list context';