diff options
author | Nicholas Clark <nick@ccl4.org> | 2021-09-22 10:58:00 +0000 |
---|---|---|
committer | Ricardo Signes <rjbs@semiotic.systems> | 2021-10-15 09:28:27 -0400 |
commit | 4eb63851541cd149fb854155d3664e3814d9583d (patch) | |
tree | 99b5f7fe2d3317128853a1e0f6024521dedcc0c8 | |
parent | ebb7bd1b0e2c6d7fb94fe2cec384474e18ffb4a1 (diff) | |
download | perl-4eb63851541cd149fb854155d3664e3814d9583d.tar.gz |
Pod improvements suggested by Matthew Horsfall
-rw-r--r-- | pod/perldelta.pod | 2 | ||||
-rw-r--r-- | pod/perldiag.pod | 2 | ||||
-rw-r--r-- | pod/perlsyn.pod | 14 |
3 files changed, 9 insertions, 9 deletions
diff --git a/pod/perldelta.pod b/pod/perldelta.pod index d8a5839dd4..73440be00e 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -21,7 +21,7 @@ XXX Any important notices here =head1 Core Enhancements -=head2 iterating over multiple values at a time. +=head2 iterating over multiple values at a time As of Perl 5.36, you can iterate over multiple values at a time by specifying a list of lexicals within parentheses. For example, diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 65195da954..7efc1375ea 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -2448,7 +2448,7 @@ same name? =item for my (...) is experimental (S experimental::for_list) This warning is emitted if you use C<for> to -iterate multiple values n-at-a-time. This syntax is currently experimental +iterate multiple values at a time. This syntax is currently experimental and its behaviour may change in future releases of Perl. =item Format not terminated diff --git a/pod/perlsyn.pod b/pod/perlsyn.pod index c62992f0ca..627c9647f4 100644 --- a/pod/perlsyn.pod +++ b/pod/perlsyn.pod @@ -283,7 +283,7 @@ The following compound statements may be used to control flow: PHASE BLOCK As of Perl 5.36, you can iterate over multiple values at a time by specifying -a list of lexicals within parentheses +a list of lexicals within parentheses: no warnings "experimental::for_list"; LABEL for my (VAR, VAR) (LIST) BLOCK @@ -558,13 +558,13 @@ followed by C<my>. To use this form, you must enable the C<refaliasing> feature via C<use feature>. (See L<feature>. See also L<perlref/Assigning to References>.) -As of Perl 5.36, you can iterate over a list of lexical scalars n-at-a-time. -You can only iterate over scalars - unlike list assignment, it's not -possible to use C<undef> to signify a value that isn't wanted. This is a -limitation of the current implementation, and might be changed in the -future. +As of Perl 5.36, you can iterate over multiple values at a time. +You can only iterate with lexical scalars as the iterator variables - unlike +list assignment, it's not possible to use C<undef> to signify a value that +isn't wanted. This is a limitation of the current implementation, and might +be changed in the future. -If the size of the LIST is not an exact multiple of number of iterator +If the size of the LIST is not an exact multiple of the number of iterator variables, then on the last iteration the "excess" iterator variables are aliases to C<undef>, as if the LIST had C<, undef> appended as many times as needed for its length to become an exact multiple. This happens whether |