summaryrefslogtreecommitdiff
path: root/pod/perldata.pod
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-10-10 17:40:13 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-10-10 17:40:13 +0000
commit08cd895235a7add1a6101888189211e99f27e0dd (patch)
tree48c5116cc3fe55f2427b562962c52cd16a387e1d /pod/perldata.pod
parent1ea4ab9106bc343e10e638c6106351b0aafbbed9 (diff)
downloadperl-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.pod8
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: