diff options
Diffstat (limited to 'dist/Env')
-rw-r--r-- | dist/Env/lib/Env.pm | 2 | ||||
-rw-r--r-- | dist/Env/t/array.t | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/dist/Env/lib/Env.pm b/dist/Env/lib/Env.pm index 1f3713afdf..6e6cd8b230 100644 --- a/dist/Env/lib/Env.pm +++ b/dist/Env/lib/Env.pm @@ -211,7 +211,7 @@ sub SPLICE { 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 { diff --git a/dist/Env/t/array.t b/dist/Env/t/array.t index 9e87f4a6b2..d0291744ad 100644 --- a/dist/Env/t/array.t +++ b/dist/Env/t/array.t @@ -6,7 +6,7 @@ use strict; 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); @@ -64,3 +64,7 @@ is_deeply(\@FOO, \@BAR, "Sort"); 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'; |