This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #114498] lslice returning empty vs undef
authorFather Chrysostomos <sprout@cpan.org>
Wed, 3 Dec 2014 21:55:03 +0000 (13:55 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 4 Dec 2014 01:48:26 +0000 (17:48 -0800)
commitcbce292e0bfa19940c2aac7701c8ae7ca79366e5
tree91bb9f7061c52d58b1376542dd58bf0474a9bb90
parentb813f4458249da44eff5ac0843dc28de22112299
[perl #114498] lslice returning empty vs undef

Formerly, list slice would return an empty list if all the indices
fell outside the actual list, but would return ‘undef’ for every index
specified if but one of them fell within the list.

This was not implemented according to the original design, according
to which list slice would give an empty list (for a non-zero number of
indices) only if the list on the left-hand side were empty.

This commit rectifies that.  See ticket #114498 for the discussion.
pp.c
t/op/list.t