Skip to content

Commit

Permalink
perldelta for n-at-a-time for loops.
Browse files Browse the repository at this point in the history
  • Loading branch information
nwc10 committed Jun 28, 2021
1 parent 8fbfa36 commit 0c36ae8
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pod/perldelta.pod
Expand Up @@ -21,11 +21,17 @@ XXX Any important notices here

=head1 Core Enhancements

XXX New core language features go here. Summarize user-visible core language
enhancements. Particularly prominent performance optimisations could go
here, but most should go in the L</Performance Enhancements> section.
=head2 iterating over multiple values at a time.

[ List each enhancement as a =head2 entry ]
As of Perl 5.36, you can iterate over multiple values at a time by specifying
a list of lexicals within parentheses. For example,

for my ($key, $value) (%hash) { ... }
for my ($left, $right, $gripping) (@moties) { ... }

Attempting to specify a list after C<for my> was previously a syntax error.

For more detail see L<perlsyn/Compound Statements>.

=head1 Security

Expand Down

0 comments on commit 0c36ae8

Please sign in to comment.