Skip to content

Commit

Permalink
Add perldelta
Browse files Browse the repository at this point in the history
  • Loading branch information
leonerd committed Nov 6, 2024
1 parent 08785fa commit 2115e46
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pod/perldelta.pod
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,23 @@ There may well be none in a stable release.

XXX

=item *

Code that uses the C<indexed> function from the L<builtin> module to generate
a list of index/value pairs out of array which is then passed into a
two-variable C<foreach> list to unpack those again is now optimised to be more
efficient.

my @array = (...);

foreach my ($idx, $val) (builtin::indexed @array) {
...
}

In particular, a temporary list twice the size of the original
array is no longer generated. Instead, the list iterates down the array
in-place directly, in the same way that C<foreach (@array)> would do.

=back

=head1 Modules and Pragmata
Expand Down

0 comments on commit 2115e46

Please sign in to comment.