Skip to content

Commit 1731242

Browse files
committed
perldelta for 6372338
1 parent 6372338 commit 1731242

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

pod/perldelta.pod

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,29 @@ manager will later use a regex to expand these into links.
366366

367367
=item *
368368

369-
XXX
369+
Certain constructs involving a two-variable C<for> loop would crash the perl
370+
compiler in v5.42.0:
371+
372+
# Two-variable for loop over a list returned from a method call:
373+
for my ($x, $y) (Some::Class->foo()) { ... }
374+
for my ($x, $y) ($object->foo()) { ... }
375+
376+
and
377+
378+
# Two-variable for loop over a list returned from a call to a
379+
# lexical(ly imported) subroutine, all inside a lexically scoped
380+
# or anonymous subroutine:
381+
my sub foo { ... }
382+
my $fn = sub {
383+
for my ($x, $y) (foo()) { ... }
384+
};
385+
386+
use builtin qw(indexed); # lexical import!
387+
my sub bar {
388+
for my ($x, $y) (indexed(...)) { ... }
389+
}
390+
391+
These have been fixed. [GH #23405]
370392

371393
=back
372394

0 commit comments

Comments
 (0)