diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-10-10 17:40:13 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-10-10 17:40:13 +0000 |
commit | 08cd895235a7add1a6101888189211e99f27e0dd (patch) | |
tree | 48c5116cc3fe55f2427b562962c52cd16a387e1d /pod/perldata.pod | |
parent | 1ea4ab9106bc343e10e638c6106351b0aafbbed9 (diff) | |
download | perl-08cd895235a7add1a6101888189211e99f27e0dd.tar.gz |
update perldelta for change#3406
p4raw-link: @3406 on //depot/perl: c73bf8e3ece265b261438c8090fb5ecbf0977587
p4raw-id: //depot/perl@4337
Diffstat (limited to 'pod/perldata.pod')
-rw-r--r-- | pod/perldata.pod | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pod/perldata.pod b/pod/perldata.pod index 067c6d9bd5..0b83214a73 100644 --- a/pod/perldata.pod +++ b/pod/perldata.pod @@ -648,8 +648,12 @@ You couldn't just loop through C<values %hash> to do this because that function produces a new list which is a copy of the values, so changing them doesn't change the original. -As a special rule, if a list slice would produce a list consisting -entirely of undefined values, the null list is produced instead. +A slice of an empty list is still an empty list. Thus: + + @a = ()[1,0]; # @a has no elements + @b = (@a)[0,1]; # @b has no elements + @b = (1,undef)[1,0,1]; # @b has three elements + This makes it easy to write loops that terminate when a null list is returned: |