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