This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add perldelta entry for the four new functions
[perl5.git] / pod / perl5355delta.pod
CommitLineData
6247a13a
LT
1=encoding utf8
2
3=head1 NAME
4
5perl5355delta - what is new for perl v5.35.5
6
7=head1 DESCRIPTION
8
9This document describes differences between the 5.35.4 release and the 5.35.5
10release.
11
12If you are upgrading from an earlier release such as 5.35.3, first read
13L<perl5354delta>, which describes differences between 5.35.3 and 5.35.4.
14
15=head1 Core Enhancements
16
17=head2 iterating over multiple values at a time
18
19As of Perl 5.36, you can iterate over multiple values at a time by specifying
20a list of lexicals within parentheses. For example,
21
22 for my ($key, $value) (%hash) { ... }
23 for my ($left, $right, $gripping) (@moties) { ... }
24
25Attempting to specify a list after C<for my> was previously a syntax error.
26
27For more detail see L<perlsyn/Compound Statements>.
28
29=head1 Incompatible Changes
30
31There are no changes intentionally incompatible with 5.35.4
32If any exist, they are bugs, and we request that you submit a
33report. See L</Reporting Bugs> below.
34
35=head1 Modules and Pragmata
36
37=head2 Updated Modules and Pragmata
38
39=over 4
40
41=item *
42
43L<B::Concise> has been upgraded from version 1.005 to 1.006.
44
45=item *
46
47L<B::Deparse> has been upgraded from version 1.58 to 1.59.
48
49=item *
50
51L<Digest> has been upgraded from version 1.19 to 1.20.
52
53=item *
54
55L<DynaLoader> has been upgraded from version 1.51 to 1.52.
56
57=item *
58
59L<Encode> has been upgraded from version 3.12 to 3.16.
60
61=item *
62
63L<Errno> has been upgraded from version 1.34 to 1.35.
64
65=item *
66
67L<experimental> has been upgraded from version 0.024 to 0.025.
68
69=item *
70
71L<File::Copy> has been upgraded from version 2.36 to 2.37.
72
73=item *
74
75L<FindBin> has been upgraded from version 1.52 to 1.53.
76
77=item *
78
79L<GDBM_File> has been upgraded from version 1.20 to 1.21.
80
81=item *
82
83L<HTTP::Tiny> has been upgraded from version 0.076 to 0.078.
84
85=item *
86
87L<I18N::Langinfo> has been upgraded from version 0.20 to 0.21.
88
89=item *
90
91L<Module::CoreList> has been upgraded from version 5.20210920 to 5.20211020.
92
93=item *
94
95L<POSIX> has been upgraded from version 1.99 to 2.01.
96
97=item *
98
99L<Scalar::Util> has been upgraded from version 1.56_001 to 1.60.
100
101=item *
102
103L<Test::Simple> has been upgraded from version 1.302185 to 1.302188.
104
105=item *
106
107L<Tie::Handle> has been upgraded from version 4.2 to 4.3.
108
109=item *
110
111L<Tie::Hash> has been upgraded from version 1.05 to 1.06.
112
113=item *
114
115L<Tie::Scalar> has been upgraded from version 1.05 to 1.06.
116
117=item *
118
119L<warnings> has been upgraded from version 1.54 to 1.55.
120
121=item *
122
123L<XS::APItest> has been upgraded from version 1.19 to 1.20.
124
125=back
126
127=head1 Documentation
128
129=head2 Changes to Existing Documentation
130
131We have attempted to update the documentation to reflect the changes
132listed in this document. If you find any we have missed, open an issue
133at L<https://github.com/Perl/perl5/issues>.
134
135Additionally, the following selected changes have been made:
136
137=head3 L<perlgov>
138
139=over 4
140
141=item *
142
143The election process has been finetuned to allow the vote to be skipped if there
144are no more candidates than open seats.
145
146=item *
147
148A special election is now allowed to be postponed for up to twelve weeks, for
149example until a normal election.
150
151=back
152
153=head1 Diagnostics
154
155The following additions or changes have been made to diagnostic output,
156including warnings and fatal error messages. For the complete list of
157diagnostic messages, see L<perldiag>.
158
159=head2 New Diagnostics
160
161=head3 New Errors
162
163=over 4
164
165=item *
166
167L<panic: newFORLOOP, %s|perldiag/"panic: newFORLOOP, %s">
168
169The parser failed an internal consistency check while trying to parse
170a C<foreach> loop.
171
172=back
173
174=head3 New Warnings
175
176=over 4
177
178=item *
179
180L<for my (...) is experimental|perldiag/"for my (...) is experimental">
181
182This warning is emitted if you use C<for> to iterate multiple values at
183a time. This syntax is currently experimental and its behaviour may
184change in future releases of Perl.
185
186=back
187
188=head2 Changes to Existing Diagnostics
189
190=over 4
191
192=item * L<'E<sol>' does not take a repeat count in %s|perldiag/"'/' does not take a repeat count in %s">
193
194This warning used to not include the C<in %s>.
195
196=back
197
198=head1 Configuration and Compilation
199
200=over 4
201
202=item *
203
204The Perl C source code now uses some C99 features, which we have verified are
205supported by all compilers we target. This means that Perl's headers now
206contain some code that is legal in C99 but not C89.
207
208This may cause problems for some XS modules that unconditionally add
209C<-Werror=declaration-after-statement> to their C compiler flags if compiling
210with gcc or clang. Earlier versions of Perl support long obsolete compilers
211that are strict in rejecting certain C99 features, particularly mixed
212declarations and code, and hence it makes sense for XS module authors to audit
213that their code does not violate this. However, doing this is now only
214possible on these earlier versions of Perl, hence these modules need to be
215changed to only add this flag for C<<$] < 5.035005>>.
216
217=back
218
219=head1 Testing
220
221Tests were added and changed to reflect the other additions and
222changes in this release. Furthermore, these significant changes were
223made:
224
225=over 4
226
227=item * t/op/for-many.t was added
228
229This tests for looping of multiple values as the same time
230
231=back
232
233=head1 Platform Support
234
235=head2 Discontinued Platforms
236
237=over 4
238
239=item NetWare
240
241Support code for Novell NetWare has been removed. NetWare was a
242server operating system by Novell. The port was last updated in July
2432002, and the platform itself in May 2009.
244
245Unrelated changes accidentally broke the build for the NetWare port in
246September 2009, and in 12 years no-one has reported this.
247
248=back
249
250=head2 Platform-Specific Notes
251
252=over 4
253
254=item Windows
255
256Support for old MSVC++ (pre-VC12) has been removed
257
258These did not support C99 and hence can no longer be used to compile perl.
259
260=back
261
262=head1 Internal Changes
263
264=over 4
265
266=item *
267
268Memory for hash iterator state (C<struct xpvhv_aux>) is now allocated as part
269of the hash body, instead of as part of the block of memory allocated for the
270main hash array.
271
272Nothing else changes - memory for this structure is still allocated only when
273needed, is still accessed via the C<HvAUX()> macro, and the macro should only
274be called when C<SvOOK()> is true. Hashes are still always of type C<SVt_PVHV>,
275hash bodies are still allocated from arenas, and the address of the hash
276doesn't change, because the address is the pointer to the head structure, which
277never moves.
278
279Internally, a second arena (the arena with index 1) is used to allocate larger
280bodies with space for C<struct xpvhv_aux>, the body "upgraded", and the "head"
281structure updated to reflect this (much the same way that the bodies of scalars
282are upgraded). We already re-purpose arenas - arena with index 0 is used for
283C<HE *>s.
284
285None of this affects documented public XS interfaces. The only code changes are
286in F<hv.c> and F<sv.c>. As the rest of the core itself uses these macros but
287needed no changes, likely no code on CPAN will be affected either.
288
289=back
290
291=head1 Selected Bug Fixes
292
293=over 4
294
295=item *
296
297Calling C<untie> on a tied hash that is partway through iteration now frees the
298iteration state immediately.
299
300Iterating a tied hash causes perl to store a copy of the current hash key to
301track the iteration state, with this stored copy passed as the second parameter
302to C<NEXTKEY>. This internal state is freed immediately when tie hash iteration
303completes, or if the hash is destroyed, but due to an implementation oversight,
304it was not freed if the hash was untied. In that case, the internal copy of the
305key would persist until the earliest of
306
307=over 4
308
309=item 1
310
311C<tie> was called again on the same hash
312
313=item 2
314
315The (now untied) hash was iterated (ie passed to any of C<keys>, C<values> or
316C<each>)
317
318=item 3
319
320The hash was destroyed.
321
322=back
323
324This inconsistency is now fixed - the internal state is now freed immediately by
325C<untie>.
326
327As the precise timing of this behaviour can be observed with pure Perl code
328(the timing of C<DESTROY> on objects returned from C<FIRSTKEY> and C<NEXTKEY>)
329it's just possible that some code is sensitive to it.
330
331=item *
332
333The C<Internals::getcwd()> function added for bootstrapping miniperl
334in perl 5.30.0 is now only available in miniperl. [github #19122]
335
336=back
337
338=head1 Acknowledgements
339
340Perl 5.35.5 represents approximately 4 weeks of development since Perl
3415.35.4 and contains approximately 32,000 lines of changes across 380 files
342from 22 authors.
343
344Excluding auto-generated files, documentation and release tools, there were
345approximately 17,000 lines of changes to 260 .pm, .t, .c and .h files.
346
347Perl continues to flourish into its fourth decade thanks to a vibrant
348community of users and developers. The following people are known to have
349contributed the improvements that became Perl 5.35.5:
350
351Andrew Fresh, Chris 'BinGOs' Williams, Dagfinn Ilmari Mannsåker, Dan Book,
352Dan Kogai, David Mitchell, E. Choroba, Hugo van der Sanden, James E Keenan,
353Karl Williamson, Leon Timmermans, Matthew Horsfall, Nicholas Clark, Olaf
354Alders, Paul Evans, Ricardo Signes, Richard Leach, Sergey Poznyakoff, Steve
355Hay, TAKAI Kousuke, Tomasz Konojacki, Tony Cook.
356
357The list above is almost certainly incomplete as it is automatically
358generated from version control history. In particular, it does not include
359the names of the (very much appreciated) contributors who reported issues to
360the Perl bug tracker.
361
362Many of the changes included in this version originated in the CPAN modules
363included in Perl's core. We're grateful to the entire CPAN community for
364helping Perl to flourish.
365
366For a more complete list of all of Perl's historical contributors, please
367see the F<AUTHORS> file in the Perl source distribution.
368
369=head1 Reporting Bugs
370
371If you find what you think is a bug, you might check the perl bug database
372at L<https://github.com/Perl/perl5/issues>. There may also be information at
373L<http://www.perl.org/>, the Perl Home Page.
374
375If you believe you have an unreported bug, please open an issue at
376L<https://github.com/Perl/perl5/issues>. Be sure to trim your bug down to a
377tiny but sufficient test case.
378
379If the bug you are reporting has security implications which make it
380inappropriate to send to a public issue tracker, then see
381L<perlsec/SECURITY VULNERABILITY CONTACT INFORMATION>
382for details of how to report the issue.
383
384=head1 Give Thanks
385
386If you wish to thank the Perl 5 Porters for the work we had done in Perl 5,
387you can do so by running the C<perlthanks> program:
388
389 perlthanks
390
391This will send an email to the Perl 5 Porters list with your show of thanks.
392
393=head1 SEE ALSO
394
395The F<Changes> file for an explanation of how to view exhaustive details on
396what changed.
397
398The F<INSTALL> file for how to build Perl.
399
400The F<README> file for general stuff.
401
402The F<Artistic> and F<Copying> files for copyright information.
403
404=cut