Commit | Line | Data |
---|---|---|
0382c61d | 1 | =encoding utf8 |
7b0fb693 | 2 | |
0382c61d | 3 | =head1 NAME |
7b0fb693 | 4 | |
a2cea410 | 5 | perldelta - what is new for perl v5.36.0 |
2f9090fc | 6 | |
b129a266 | 7 | =head1 DESCRIPTION |
2f9090fc | 8 | |
6be0b98a | 9 | This document describes differences between the 5.34.0 release and the 5.36.0 |
b129a266 | 10 | release. |
2f9090fc | 11 | |
9e71a8df | 12 | =head1 Core Enhancements |
9623941f | 13 | |
18680407 | 14 | =head2 C<use v5.36> |
6fe03a92 | 15 | |
18680407 | 16 | As always, C<use v5.36> turns on the feature bundle for that version of Perl. |
78684fb7 | 17 | |
18680407 RS |
18 | The 5.36 bundle enables the C<signatures> feature. Introduced in Perl version |
19 | 5.20.0, and modified several times since, the subroutine signatures feature is | |
20 | now no longer considered experimental. It is now considered a stable language | |
21 | feature and no longer prints a warning. | |
d2941388 | 22 | |
18680407 RS |
23 | use v5.36; |
24 | ||
25 | sub add ($x, $y) { | |
26 | return $x + $y; | |
27 | } | |
28 | ||
29 | Despite this, certain elements of signatured subroutines remain experimental; | |
30 | see below. | |
31 | ||
32 | The 5.36 bundle enables the C<isa> feature. Introduced in Perl version 5.32.0, | |
33 | this operator has remained unchanged since then. The operator is now considered | |
34 | a stable language feature. For more detail see L<perlop/Class Instance | |
35 | Operator>. | |
36 | ||
6a2d252d RS |
37 | The 5.36 bundle also I<disables> the features C<indirect>, and |
38 | C<multidimensional>. These will forbid, respectively: the use of "indirect" | |
18680407 RS |
39 | method calls (like C<$x = new Class;>); the use of a list expression as a hash |
40 | key to simulate sparse multidimensional arrays. The specifics of these changes | |
41 | can be found in L<feature>, but the short version is: this is a bit like having | |
42 | more C<use strict> turned on, disabling features that cause more trouble than | |
ee5e1868 | 43 | they're worth. |
18680407 RS |
44 | |
45 | Furthermore, C<use v5.36> will also enable warnings as if you'd written C<use | |
46 | warnings>. | |
d2941388 | 47 | |
e70f3e76 RS |
48 | Finally, with this release, the experimental C<switch> feature, present in |
49 | every feature bundle since they were introduced in v5.10, has been removed from | |
50 | the v5.36 bundle. If you want to use it (against our advice), you'll have to | |
51 | enable it explicitly. | |
52 | ||
6da5bb6f | 53 | =head2 -g command-line flag |
6fe03a92 | 54 | |
6da5bb6f | 55 | A new command-line flag, -g, is available. It is a simpler alias for -0777. |
6fe03a92 | 56 | |
6da5bb6f | 57 | For more information, see L<perlrun/-g>. |
6fe03a92 RS |
58 | |
59 | =head2 Unicode 14.0 is supported | |
60 | ||
61 | See L<https://www.unicode.org/versions/Unicode14.0.0/> for details. | |
62 | ||
54700c0d KW |
63 | =head2 regex sets are no longer considered experimental |
64 | ||
65 | Prior to this release, the regex sets feature (officially named | |
66 | "Extended Bracketed Character Classes") was considered experimental. | |
67 | Introduced in Perl version 5.18.0, and modified several times since, | |
68 | this is now considered a stable language feature and its use no longer | |
69 | prints a warning. See L<perlrecharclass/Extended Bracketed Character | |
70 | Classes>. | |
71 | ||
6da5bb6f RS |
72 | =head2 Variable length lookbehind is mostly no longer considered experimental |
73 | ||
127c62f8 | 74 | Prior to this release, any form of variable length lookbehind was |
6da5bb6f RS |
75 | considered experimental. With this release the experimental status has |
76 | been reduced to cover only lookbehind that contains capturing parenthesis. | |
77 | This is because it is not clear if | |
78 | ||
79 | "aaz"=~/(?=z)(?<=(a|aa))/ | |
80 | ||
81 | should match and leave $1 equaling "a" or "aa". Currently it will match | |
cb470766 | 82 | the longest possible alternative, "aa". While we are confident that the overall |
6da5bb6f RS |
83 | construct will now match only when it should, we are not confident that we |
84 | will keep the current "longest match" behavior. | |
85 | ||
6fe03a92 RS |
86 | =head2 SIGFPE no longer deferred |
87 | ||
88 | Floating-point exceptions are now delivered immediately, in the same way | |
89 | as other "fault"-like signals such as SIGSEGV. This means one has at | |
90 | least a chance to catch such a signal with a C<$SIG{FPE}> handler, e.g. | |
91 | so that C<die> can report the line in perl that triggered it. | |
92 | ||
93 | =head2 Stable boolean tracking | |
94 | ||
95 | The "true" and "false" boolean values, often accessed by constructions like | |
96 | C<!!0> and C<!!1>, as well as being returned from many core functions and | |
97 | operators, now remember their boolean nature even through assignment into | |
62fa8c24 | 98 | variables. The new function C<is_bool()> in L<builtin> can check whether |
6fe03a92 RS |
99 | a value has boolean nature. |
100 | ||
101 | This is likely to be useful when interoperating with other languages or | |
102 | data-type serialisation, among other places. | |
103 | ||
6da5bb6f | 104 | =head2 iterating over multiple values at a time (experimental) |
a993f9e1 | 105 | |
6da5bb6f RS |
106 | You can now iterate over multiple values at a time by specifying a list of |
107 | lexicals within parentheses. For example, | |
a993f9e1 RS |
108 | |
109 | for my ($key, $value) (%hash) { ... } | |
110 | for my ($left, $right, $gripping) (@moties) { ... } | |
111 | ||
6da5bb6f RS |
112 | Prior to perl v5.36, attempting to specify a list after C<for my> was a syntax |
113 | error. | |
a993f9e1 | 114 | |
6da5bb6f RS |
115 | This feature is currently experimental and will cause a warning of category |
116 | C<experimental::for_list>. For more detail see L<perlsyn/Compound Statements>. | |
117 | See also L</builtin::indexed> in this document, which is a handy companion to | |
118 | n-at-a-time foreach. | |
6fe03a92 | 119 | |
6da5bb6f | 120 | =head2 builtin functions (experimental) |
0b53d7f5 RS |
121 | |
122 | A new core module L<builtin> has been added, which provides documentation for | |
123 | new always-present functions that are built into the interpreter. | |
124 | ||
125 | say "Reference type of arrays is ", builtin::reftype([]); | |
126 | ||
127 | It also provides a lexical import mechanism for providing short name versions | |
128 | of these functions. | |
129 | ||
130 | use builtin 'reftype'; | |
131 | say "Reference type of arrays is ", reftype([]); | |
132 | ||
0b53d7f5 | 133 | This builtin function mechanism and the functions it provides are all |
6da5bb6f RS |
134 | currently B<experimental>. We expect that C<builtin> itself will cease to be |
135 | experimental in the near future, but that individual functions in it may become | |
136 | stable on an ongoing basis. Other functions will be added to C<builtin> over | |
137 | time. | |
138 | ||
139 | For details, see L<builtin>, but here's a summary of builtin functions in | |
140 | v5.36: | |
141 | ||
142 | =over 4 | |
0b53d7f5 | 143 | |
6da5bb6f RS |
144 | =item builtin::trim |
145 | ||
146 | This function treats its argument as a string, returning the result of removing | |
147 | all white space at its beginning and ending. | |
148 | ||
149 | =item builtin::indexed | |
150 | ||
151 | This function returns a list twice as big as its argument list, where each item | |
152 | is preceded by its index within that list. This is primarily useful for using | |
153 | the new C<foreach> syntax with multiple iterator variables to iterate over an | |
154 | array or list, while also tracking the index of each item: | |
155 | ||
156 | use builtin 'indexed'; | |
157 | ||
158 | foreach my ($index, $val) (indexed @array) { | |
159 | ... | |
160 | } | |
161 | ||
162 | =item builtin::true, builtin::false, builtin::is_bool | |
163 | ||
164 | C<true> and C<false> return boolean true and false values. Perl is still perl, | |
165 | and doesn't have strict typing of booleans, but these values will be known to | |
166 | have been created as booleans. C<is_bool> will tell you whether a value was | |
167 | known to have been created as a boolean. | |
168 | ||
169 | =item builtin::weaken, builtin::unweaken, builtin::is_weak | |
170 | ||
ee5e1868 | 171 | These functions will, respectively: weaken a reference; strengthen a reference; |
6da5bb6f RS |
172 | and return whether a reference is weak. (A weak reference is not counted for |
173 | garbage collection purposes. See L<perlref>.) These can take the place of | |
174 | some similar routines in L<Scalar::Util>. | |
175 | ||
176 | =item builtin::blessed, builtin::refaddr, builtin::reftype | |
177 | ||
178 | These functions provide more data about references (or non-references, | |
179 | actually!) and can take the place of similar routines found in L<Scalar::Util>. | |
180 | ||
181 | =item builtin::ceil, builtin::floor | |
182 | ||
183 | C<ceil> returns the smallest integer greater than or equal to its argument. | |
184 | C<floor> returns the largest integer less than or equal to its argument. These | |
185 | can take the place of similar routines found in L<POSIX>. | |
186 | ||
187 | =back | |
188 | ||
189 | =head2 C<defer> blocks (experimental) | |
190 | ||
191 | This release adds support for C<defer> blocks, which are blocks of code | |
192 | prefixed by the C<defer> modifier. They provide a section of code which runs | |
193 | at a later time, during scope exit. | |
0b53d7f5 | 194 | |
6da5bb6f RS |
195 | In brief, when a C<defer> block is reached at runtime, its body is set aside to |
196 | be run when the enclosing scope is exited. It is unlike a UNITCHECK (among | |
197 | other reasons) in that if the block I<containing> the C<defer> block is exited | |
198 | before the block is reached, it will not be run. | |
199 | ||
200 | C<defer> blocks can be used to take the place of "scope guard" objects where an | |
201 | object is passed a code block to be run by its destructor. | |
202 | ||
203 | For more information, see L<perlsyn/"defer blocks">. | |
204 | ||
205 | =head2 try/catch can now have a C<finally> block (experimental) | |
b3d76e6f RS |
206 | |
207 | The experimental C<try>/C<catch> syntax has been extended to support an | |
208 | optional third block introduced by the C<finally> keyword. | |
209 | ||
210 | try { | |
211 | attempt(); | |
212 | print "Success\n"; | |
213 | } | |
214 | catch ($e) { | |
215 | print "Failure\n"; | |
216 | } | |
217 | finally { | |
218 | print "This happens regardless\n"; | |
219 | } | |
220 | ||
221 | This provides code which runs at the end of the C<try>/C<catch> construct, | |
222 | even if aborted by an exception or control-flow keyword. They are similar | |
223 | to C<defer> blocks. | |
224 | ||
225 | For more information, see L<perlsyn/"Try Catch Exception Handling">. | |
226 | ||
6da5bb6f RS |
227 | =head2 non-ASCII delimiters for quote-like operators (experimental) |
228 | ||
229 | Perl traditionally has allowed just four pairs of string/pattern | |
230 | delimiters: S<C<( )>> S<C<{ }>> S<C<[ ]>> and S<C<< < > >>>, all in the | |
231 | ASCII range. Unicode has hundreds more possibilities, and using this | |
232 | feature enables many of them. When enabled, you can say S<C<qr« »>> for | |
233 | example, or S<C<use utf8; q𝄃string𝄂>>. See L<feature/The | |
234 | 'extra_paired_delimiters' feature> for details. | |
235 | ||
953a3553 RS |
236 | =head2 @_ is now experimental within signatured subs |
237 | ||
6da5bb6f RS |
238 | Even though subroutine signatures are now stable, use of the legacy arguments |
239 | array (C<@_>) with a subroutine that has a signature I<remains> experimental, | |
953a3553 | 240 | with its own warning category. Silencing the C<experimental::signatures> |
6da5bb6f RS |
241 | warning category is not sufficient to dismiss this. The new warning is emitted |
242 | with the category name C<experimental::args_array_with_signatures>. | |
953a3553 RS |
243 | |
244 | Any subroutine that has a signature and tries to make use of the defaults | |
245 | argument array or an element thereof (C<@_> or C<$_[INDEX]>), either | |
246 | explicitly or implicitly (such as C<shift> or C<pop> with no argument) will | |
247 | provoke a warning at compile-time: | |
248 | ||
249 | use v5.36; | |
250 | ||
251 | sub f ($x, $y = 123) { | |
252 | say "The first argument is $_[0]"; | |
253 | } | |
254 | ||
255 | Z<> | |
256 | ||
257 | Use of @_ in array element with signatured subroutine is experimental | |
258 | at file.pl line 4. | |
259 | ||
260 | The behaviour of code which attempts to do this is no longer specified, and | |
261 | may be subject to change in a future version. | |
262 | ||
6acd8d81 | 263 | =head1 Incompatible Changes |
088588be | 264 | |
b3d76e6f | 265 | =head2 A physically empty sort is now a compile-time error |
c15a34bf | 266 | |
b3d76e6f RS |
267 | @a = sort @empty; # unaffected |
268 | @a = sort; # now a compile-time error | |
60b43c2a | 269 | @a = sort (); # also a compile-time error |
c15a34bf | 270 | |
b3d76e6f | 271 | A bare sort used to be a weird way to create an empty list; now it croaks |
ee5e1868 RS |
272 | at compile time. This change is intended to free up some of the syntax space |
273 | for possible future enhancements to C<sort>. | |
c15a34bf | 274 | |
6acd8d81 | 275 | =head1 Deprecations |
c15a34bf | 276 | |
cb470766 | 277 | =head2 C<use VERSION> (where VERSION is below v5.11) after C<use v5.11> is deprecated |
953a3553 | 278 | |
c9928b61 RS |
279 | When in the scope of C<use v5.11> or later, a C<use vX> line where I<X> is |
280 | lower than v5.11 will now issue a warning: | |
281 | ||
282 | Downgrading a use VERSION declaration to below v5.11 is deprecated | |
953a3553 RS |
283 | |
284 | For example: | |
285 | ||
286 | use v5.14; | |
287 | say "The say statement is permitted"; | |
288 | use v5.8; # This will print a warning | |
289 | print "We must use print\n"; | |
290 | ||
c9928b61 RS |
291 | This is because the Perl team plans to change the behavior in this case. Since |
292 | Perl v5.12 (and parts of v5.11), strict is enabled I<unless it had previously | |
293 | been disabled>. In other words: | |
294 | ||
295 | no strict; | |
296 | use v5.12; # will not enable strict, because "no strict" preceded it | |
297 | $x = 1; # permitted, despite no "my" declaration | |
298 | ||
284bff35 RS |
299 | In the future, this behavior will be eliminated and C<use VERSION> will |
300 | I<always> enable strict for versions v5.12 and later. | |
953a3553 RS |
301 | |
302 | Code which wishes to mix versions in this manner should use lexical scoping | |
303 | with block syntax to ensure that the differently versioned regions remain | |
304 | lexically isolated. | |
305 | ||
306 | { | |
307 | use v5.14; | |
308 | say "The say statement is permitted"; | |
309 | } | |
310 | ||
311 | { | |
312 | use v5.8; # No warning is emitted | |
313 | print "We must use print\n"; | |
314 | } | |
fa5eb2fe | 315 | |
c9928b61 RS |
316 | Of course, this is probably not something you ever need to do! If the first |
317 | block compiles, it means you're using perl v5.14.0 or later. | |
78684fb7 | 318 | |
6acd8d81 | 319 | =head1 Performance Enhancements |
78684fb7 | 320 | |
6acd8d81 | 321 | =over 4 |
78684fb7 | 322 | |
5810f283 | 323 | =item * |
78684fb7 | 324 | |
6fe03a92 RS |
325 | We now probe for compiler support for C11 thread local storage, and where |
326 | available use this for "implicit context" for XS extensions making API calls for | |
327 | a threaded Perl build. This requires fewer function calls at the C level than | |
328 | POSIX thread specific storage. We continue to use the the pthreads approach if | |
329 | the C11 approach is not available. | |
330 | ||
331 | F<Configure> run with the defaults will build an unthreaded Perl (which is | |
332 | slightly faster), but most operating systems ship a threaded Perl. | |
78684fb7 | 333 | |
8404d64a RS |
334 | =item * |
335 | ||
ac5bcfc0 KW |
336 | Perl can now be configured to no longer allocate keys for large hashes |
337 | from the shared string table. | |
8404d64a RS |
338 | |
339 | The same internal datatype (C<PVHV>) is used for all of | |
340 | ||
341 | =over 4 | |
342 | ||
343 | =item * | |
344 | ||
345 | Symbol tables | |
346 | ||
347 | =item * | |
348 | ||
349 | Objects (by default) | |
350 | ||
351 | =item * | |
352 | ||
353 | Associative arrays | |
354 | ||
355 | =back | |
356 | ||
357 | The shared string table was originally added to improve performance for blessed | |
358 | hashes used as objects, because every object instance has the same keys, so it | |
359 | is an optimisation to share memory between them. It also makes sense for symbol | |
360 | tables, where derived classes will have the same keys (typically method names), | |
361 | and the OP trees built for method calls can also share memory. The shared | |
362 | string table behaves roughly like a cache for hash keys. | |
363 | ||
364 | But for hashes actually used as associative arrays - mapping keys to values - | |
365 | typically the keys are not re-used in other hashes. For example, "seen" hashes | |
366 | are keyed by object IDs (or addresses), and logically these keys won't repeat | |
367 | in other hashes. | |
368 | ||
369 | Storing these "used just once" keys in the shared string table increases CPU | |
370 | and RAM use for no gain. For such keys the shared string table behaves as a | |
371 | cache with a 0% hit rate. Storing all the keys there increases the total size | |
372 | of the shared string table, as well as increasing the number of times it is | |
373 | resized as it grows. B<Worse> - in any environment that has "copy on write" | |
374 | memory for child process (such as a pre-forking server), the memory pages used | |
375 | for the shared string table rapidly need to be copied as the child process | |
127c62f8 | 376 | manipulates hashes. Hence if most of the shared string table is such that keys |
8404d64a RS |
377 | are used only in one place, there is no benefit from re-use within the perl |
378 | interpreter, but a high cost due to more pages for the OS to copy. | |
379 | ||
ac5bcfc0 KW |
380 | The perl interpreter can now be Configured to disable shared hash keys |
381 | for "large" hashes (that are neither objects nor symbol tables). To do | |
382 | so, add C<-Accflags='-DPERL_USE_UNSHARED_KEYS_IN_LARGE_HASHES'> to | |
383 | your F<Configure> options. "Large" is a heuristic -- currently the | |
384 | heuristic is that sharing is disabled when adding a key to a hash | |
385 | triggers allocation of more storage, and the hash has more than 42 keys. | |
8404d64a RS |
386 | |
387 | This B<might> cause slightly increased memory usage for programs that create | |
388 | (unblessed) data structures that contain multiple large hashes that share the | |
389 | same keys. But generally our testing suggests that for the specific cases | |
390 | described it is a win, and other code is unaffected. | |
391 | ||
610e1003 RS |
392 | =item * |
393 | ||
394 | In certain scenarios, creation of new scalars is now noticeably faster. | |
395 | ||
396 | For example, the following code is now executing ~30% faster: | |
397 | ||
398 | $str = "A" x 64; | |
399 | for (0..1_000_000) { | |
400 | @svs = split //, $str | |
401 | } | |
402 | ||
403 | (You can read more about this one in L<[perl | |
404 | #19414]|https://github.com/Perl/perl5/pull/19414>.) | |
405 | ||
6acd8d81 | 406 | =back |
fa92924b | 407 | |
6acd8d81 | 408 | =head1 Modules and Pragmata |
78684fb7 | 409 | |
6acd8d81 SH |
410 | =head2 Updated Modules and Pragmata |
411 | ||
412 | =over 4 | |
78684fb7 | 413 | |
5810f283 | 414 | =item * |
fa92924b | 415 | |
aae76867 | 416 | L<Archive::Tar> has been upgraded from version 2.38 to 2.40. |
fa92924b | 417 | |
aae76867 RS |
418 | =item * |
419 | ||
420 | L<Attribute::Handlers> has been upgraded from version 1.01 to 1.02. | |
421 | ||
422 | =item * | |
423 | ||
424 | L<attributes> has been upgraded from version 0.33 to 0.34. | |
425 | ||
426 | =item * | |
427 | ||
428 | L<B> has been upgraded from version 1.82 to 1.83. | |
429 | ||
430 | =item * | |
431 | ||
432 | L<B::Concise> has been upgraded from version 1.004 to 1.006. | |
433 | ||
434 | =item * | |
435 | ||
436 | L<B::Deparse> has been upgraded from version 1.56 to 1.64. | |
437 | ||
438 | =item * | |
439 | ||
440 | L<bignum> has been upgraded from version 0.51 to 0.65. | |
441 | ||
442 | =item * | |
443 | ||
444 | L<charnames> has been upgraded from version 1.48 to 1.50. | |
445 | ||
446 | =item * | |
447 | ||
448 | L<Compress::Raw::Bzip2> has been upgraded from version 2.101 to 2.103. | |
449 | ||
450 | =item * | |
451 | ||
452 | L<Compress::Raw::Zlib> has been upgraded from version 2.101 to 2.105. | |
453 | ||
454 | =item * | |
455 | ||
456 | L<CPAN> has been upgraded from version 2.28 to 2.33. | |
457 | ||
458 | =item * | |
459 | ||
460 | L<Data::Dumper> has been upgraded from version 2.179 to 2.184. | |
461 | ||
462 | =item * | |
463 | ||
464 | L<DB_File> has been upgraded from version 1.855 to 1.857. | |
465 | ||
466 | =item * | |
467 | ||
468 | L<Devel::Peek> has been upgraded from version 1.30 to 1.32. | |
469 | ||
470 | =item * | |
471 | ||
472 | L<Devel::PPPort> has been upgraded from version 3.62 to 3.68. | |
473 | ||
474 | =item * | |
475 | ||
476 | L<diagnostics> has been upgraded from version 1.37 to 1.39. | |
477 | ||
478 | =item * | |
479 | ||
480 | L<Digest> has been upgraded from version 1.19 to 1.20. | |
481 | ||
482 | =item * | |
483 | ||
484 | L<DynaLoader> has been upgraded from version 1.50 to 1.52. | |
485 | ||
486 | =item * | |
487 | ||
488 | L<Encode> has been upgraded from version 3.08 to 3.17. | |
489 | ||
490 | =item * | |
491 | ||
492 | L<Errno> has been upgraded from version 1.33 to 1.36. | |
493 | ||
494 | =item * | |
495 | ||
496 | L<experimental> has been upgraded from version 0.024 to 0.028. | |
497 | ||
498 | =item * | |
499 | ||
500 | L<Exporter> has been upgraded from version 5.76 to 5.77. | |
501 | ||
502 | =item * | |
503 | ||
504 | L<ExtUtils::MakeMaker> has been upgraded from version 7.62 to 7.64. | |
505 | ||
506 | =item * | |
507 | ||
508 | L<ExtUtils::Miniperl> has been upgraded from version 1.10 to 1.11. | |
509 | ||
510 | =item * | |
511 | ||
512 | L<ExtUtils::ParseXS> has been upgraded from version 3.43 to 3.45. | |
513 | ||
514 | =item * | |
515 | ||
516 | L<ExtUtils::Typemaps> has been upgraded from version 3.43 to 3.45. | |
517 | ||
518 | =item * | |
519 | ||
520 | L<Fcntl> has been upgraded from version 1.14 to 1.15. | |
521 | ||
522 | =item * | |
523 | ||
524 | L<feature> has been upgraded from version 1.64 to 1.72. | |
525 | ||
526 | =item * | |
527 | ||
528 | L<File::Compare> has been upgraded from version 1.1006 to 1.1007. | |
529 | ||
530 | =item * | |
531 | ||
532 | L<File::Copy> has been upgraded from version 2.35 to 2.39. | |
533 | ||
534 | =item * | |
535 | ||
536 | L<File::Fetch> has been upgraded from version 1.00 to 1.04. | |
537 | ||
538 | =item * | |
539 | ||
540 | L<File::Find> has been upgraded from version 1.39 to 1.40. | |
541 | ||
542 | =item * | |
543 | ||
544 | L<File::Glob> has been upgraded from version 1.33 to 1.37. | |
545 | ||
546 | =item * | |
547 | ||
548 | L<File::Spec> has been upgraded from version 3.80 to 3.84. | |
549 | ||
550 | =item * | |
551 | ||
552 | L<File::stat> has been upgraded from version 1.09 to 1.12. | |
553 | ||
554 | =item * | |
555 | ||
556 | L<FindBin> has been upgraded from version 1.52 to 1.53. | |
557 | ||
558 | =item * | |
559 | ||
560 | L<GDBM_File> has been upgraded from version 1.19 to 1.23. | |
561 | ||
562 | =item * | |
563 | ||
564 | L<Hash::Util> has been upgraded from version 0.25 to 0.28. | |
565 | ||
566 | =item * | |
567 | ||
568 | L<Hash::Util::FieldHash> has been upgraded from version 1.21 to 1.26. | |
569 | ||
570 | =item * | |
571 | ||
572 | L<HTTP::Tiny> has been upgraded from version 0.076 to 0.080. | |
573 | ||
574 | =item * | |
575 | ||
576 | L<I18N::Langinfo> has been upgraded from version 0.19 to 0.21. | |
577 | ||
578 | =item * | |
579 | ||
580 | L<if> has been upgraded from version 0.0609 to 0.0610. | |
581 | ||
582 | =item * | |
583 | ||
584 | L<IO> has been upgraded from version 1.46 to 1.50. | |
585 | ||
586 | =item * | |
587 | ||
a5009f17 | 588 | IO-Compress has been upgraded from version 2.102 to 2.106. |
aae76867 RS |
589 | |
590 | =item * | |
591 | ||
592 | L<IPC::Open3> has been upgraded from version 1.21 to 1.22. | |
593 | ||
594 | =item * | |
595 | ||
596 | L<JSON::PP> has been upgraded from version 4.06 to 4.07. | |
597 | ||
598 | =item * | |
599 | ||
a5009f17 | 600 | libnet has been upgraded from version 3.13 to 3.14. |
aae76867 RS |
601 | |
602 | =item * | |
603 | ||
604 | L<Locale::Maketext> has been upgraded from version 1.29 to 1.31. | |
605 | ||
606 | =item * | |
607 | ||
608 | L<Math::BigInt> has been upgraded from version 1.999818 to 1.999830. | |
609 | ||
610 | =item * | |
611 | ||
612 | L<Math::BigInt::FastCalc> has been upgraded from version 0.5009 to 0.5012. | |
613 | ||
614 | =item * | |
615 | ||
616 | L<Math::BigRat> has been upgraded from version 0.2614 to 0.2621. | |
617 | ||
618 | =item * | |
619 | ||
620 | L<Module::CoreList> has been upgraded from version 5.20210520 to 5.20220520. | |
621 | ||
622 | =item * | |
623 | ||
624 | L<mro> has been upgraded from version 1.25_001 to 1.26. | |
625 | ||
626 | =item * | |
627 | ||
628 | L<NEXT> has been upgraded from version 0.68 to 0.69. | |
629 | ||
630 | =item * | |
631 | ||
632 | L<Opcode> has been upgraded from version 1.50 to 1.57. | |
633 | ||
634 | =item * | |
635 | ||
636 | L<open> has been upgraded from version 1.12 to 1.13. | |
637 | ||
638 | =item * | |
639 | ||
640 | L<overload> has been upgraded from version 1.33 to 1.35. | |
641 | ||
642 | =item * | |
643 | ||
644 | L<perlfaq> has been upgraded from version 5.20210411 to 5.20210520. | |
645 | ||
646 | =item * | |
647 | ||
648 | L<PerlIO> has been upgraded from version 1.11 to 1.12. | |
649 | ||
650 | =item * | |
651 | ||
652 | L<Pod::Functions> has been upgraded from version 1.13 to 1.14. | |
653 | ||
654 | =item * | |
655 | ||
656 | L<Pod::Html> has been upgraded from version 1.27 to 1.33. | |
657 | ||
658 | =item * | |
659 | ||
660 | L<Pod::Simple> has been upgraded from version 3.42 to 3.43. | |
661 | ||
662 | =item * | |
663 | ||
664 | L<POSIX> has been upgraded from version 1.97 to 2.03. | |
665 | ||
666 | =item * | |
667 | ||
668 | L<re> has been upgraded from version 0.41 to 0.43. | |
669 | ||
670 | =item * | |
671 | ||
672 | L<Scalar::Util> has been upgraded from version 1.55 to 1.62. | |
673 | ||
674 | =item * | |
675 | ||
676 | L<sigtrap> has been upgraded from version 1.09 to 1.10. | |
677 | ||
678 | =item * | |
679 | ||
680 | L<Socket> has been upgraded from version 2.031 to 2.033. | |
681 | ||
682 | =item * | |
683 | ||
684 | L<sort> has been upgraded from version 2.04 to 2.05. | |
685 | ||
686 | =item * | |
687 | ||
688 | L<Storable> has been upgraded from version 3.23 to 3.26. | |
689 | ||
690 | =item * | |
691 | ||
692 | L<Sys::Hostname> has been upgraded from version 1.23 to 1.24. | |
693 | ||
694 | =item * | |
695 | ||
696 | L<Test::Harness> has been upgraded from version 3.43 to 3.44. | |
697 | ||
698 | =item * | |
699 | ||
700 | L<Test::Simple> has been upgraded from version 1.302183 to 1.302190. | |
701 | ||
702 | =item * | |
703 | ||
704 | L<Text::ParseWords> has been upgraded from version 3.30 to 3.31. | |
705 | ||
706 | =item * | |
707 | ||
708 | L<Text::Tabs> has been upgraded from version 2013.0523 to 2021.0814. | |
709 | ||
710 | =item * | |
711 | ||
712 | L<Text::Wrap> has been upgraded from version 2013.0523 to 2021.0814. | |
713 | ||
714 | =item * | |
715 | ||
716 | L<threads> has been upgraded from version 2.26 to 2.27. | |
717 | ||
718 | =item * | |
719 | ||
720 | L<threads::shared> has been upgraded from version 1.62 to 1.64. | |
721 | ||
722 | =item * | |
723 | ||
724 | L<Tie::Handle> has been upgraded from version 4.2 to 4.3. | |
725 | ||
726 | =item * | |
727 | ||
728 | L<Tie::Hash> has been upgraded from version 1.05 to 1.06. | |
729 | ||
730 | =item * | |
731 | ||
732 | L<Tie::Scalar> has been upgraded from version 1.05 to 1.06. | |
733 | ||
734 | =item * | |
735 | ||
736 | L<Tie::SubstrHash> has been upgraded from version 1.00 to 1.01. | |
737 | ||
738 | =item * | |
739 | ||
740 | L<Time::HiRes> has been upgraded from version 1.9767 to 1.9770. | |
741 | ||
742 | =item * | |
743 | ||
744 | L<Unicode::Collate> has been upgraded from version 1.29 to 1.31. | |
745 | ||
746 | =item * | |
747 | ||
748 | L<Unicode::Normalize> has been upgraded from version 1.28 to 1.31. | |
749 | ||
750 | =item * | |
751 | ||
752 | L<Unicode::UCD> has been upgraded from version 0.75 to 0.78. | |
753 | ||
754 | =item * | |
755 | ||
756 | L<UNIVERSAL> has been upgraded from version 1.13 to 1.14. | |
757 | ||
758 | =item * | |
759 | ||
760 | L<version> has been upgraded from version 0.9928 to 0.9929. | |
761 | ||
762 | =item * | |
763 | ||
764 | L<VMS::Filespec> has been upgraded from version 1.12 to 1.13. | |
765 | ||
766 | =item * | |
767 | ||
768 | L<VMS::Stdio> has been upgraded from version 2.45 to 2.46. | |
769 | ||
770 | =item * | |
771 | ||
772 | L<warnings> has been upgraded from version 1.51 to 1.58. | |
773 | ||
774 | =item * | |
775 | ||
776 | L<Win32> has been upgraded from version 0.57 to 0.59. | |
777 | ||
778 | =item * | |
779 | ||
780 | L<XS::APItest> has been upgraded from version 1.16 to 1.22. | |
781 | ||
782 | =item * | |
783 | ||
784 | L<XS::Typemap> has been upgraded from version 0.18 to 0.19. | |
785 | ||
786 | =item * | |
787 | ||
788 | L<XSLoader> has been upgraded from version 0.30 to 0.31. | |
78684fb7 | 789 | |
6acd8d81 SH |
790 | =back |
791 | ||
78684fb7 | 792 | =head1 Documentation |
1ee7332f | 793 | |
6acd8d81 SH |
794 | =head2 New Documentation |
795 | ||
682feaf6 RS |
796 | =head3 F<Porting/vote_admin_guide.pod> |
797 | ||
798 | This document provides the process for administering an election or vote | |
799 | within the Perl Core Team. | |
6acd8d81 | 800 | |
78684fb7 S |
801 | =head2 Changes to Existing Documentation |
802 | ||
803 | We have attempted to update the documentation to reflect the changes | |
804 | listed in this document. If you find any we have missed, open an issue | |
805 | at L<https://github.com/Perl/perl5/issues>. | |
806 | ||
78684fb7 S |
807 | Additionally, the following selected changes have been made: |
808 | ||
aaf9176f KW |
809 | =head3 L<perlapi> |
810 | ||
811 | =over 4 | |
812 | ||
813 | =item * | |
814 | ||
227991e4 KW |
815 | This has been cleaned up some, and more than 80% of the (previously |
816 | many) undocumented functions have now either been documented or deemed | |
817 | to have been inappropriately marked as API. | |
aaf9176f KW |
818 | |
819 | As always, Patches Welcome! | |
820 | ||
821 | =back | |
822 | ||
682feaf6 RS |
823 | =head3 L<perldeprecation> |
824 | ||
825 | =over 4 | |
826 | ||
827 | =item * | |
828 | ||
829 | notes the new location for functions moved from L<Pod::Html> to | |
830 | L<Pod::Html::Util> that are no longer intended to be used outside of core. | |
831 | ||
832 | =back | |
833 | ||
682feaf6 RS |
834 | =head3 L<perlexperiment> |
835 | ||
836 | =over 4 | |
837 | ||
838 | =item * | |
839 | ||
840 | notes the C<:win32> IO pseudolayer is removed (this happened in 5.35.2). | |
841 | ||
842 | =back | |
843 | ||
a993f9e1 RS |
844 | =head3 L<perlgov> |
845 | ||
846 | =over 4 | |
847 | ||
848 | =item * | |
849 | ||
850 | The election process has been finetuned to allow the vote to be skipped if there | |
851 | are no more candidates than open seats. | |
852 | ||
853 | =item * | |
854 | ||
855 | A special election is now allowed to be postponed for up to twelve weeks, for | |
856 | example until a normal election. | |
857 | ||
858 | =back | |
859 | ||
682feaf6 RS |
860 | =head3 L<perlop> |
861 | ||
862 | =over 4 | |
863 | ||
864 | =item * | |
865 | ||
866 | now notes that an invocant only needs to be an object or class name | |
867 | for method calls, not for subroutine references. | |
868 | ||
869 | =back | |
870 | ||
6fe03a92 RS |
871 | =head3 L<perlre> |
872 | ||
873 | =over 4 | |
874 | ||
875 | =item * | |
876 | ||
877 | Updated to discourage the use of the /d regexp modifier. | |
878 | ||
879 | =back | |
880 | ||
b3d76e6f RS |
881 | =head3 L<perlrun> |
882 | ||
883 | =over 4 | |
884 | ||
885 | =item * | |
886 | ||
887 | B<-?> is now a synonym for B<-h> | |
888 | ||
ccff69c8 RS |
889 | =item * |
890 | ||
891 | B<-g> is now a synonym for B<-0777> | |
892 | ||
b3d76e6f RS |
893 | =back |
894 | ||
6acd8d81 | 895 | =head1 Diagnostics |
1ee7332f | 896 | |
6acd8d81 SH |
897 | The following additions or changes have been made to diagnostic output, |
898 | including warnings and fatal error messages. For the complete list of | |
899 | diagnostic messages, see L<perldiag>. | |
900 | ||
6acd8d81 SH |
901 | =head2 New Diagnostics |
902 | ||
6acd8d81 SH |
903 | =head3 New Errors |
904 | ||
905 | =over 4 | |
d84985bf | 906 | |
d9113277 S |
907 | =item * |
908 | ||
a5009f17 | 909 | L<Can't "%s" out of a "defer" block|perldiag/"Can't "%s" out of a "defer" block"> |
6fe03a92 RS |
910 | |
911 | (F) An attempt was made to jump out of the scope of a defer block by using | |
912 | a control-flow statement such as C<return>, C<goto> or a loop control. This is | |
913 | not permitted. | |
78684fb7 | 914 | |
a993f9e1 RS |
915 | =item * |
916 | ||
64e6d7e4 RS |
917 | L<Can't modify %s in %s|perldiag/"Can't modify %s in %s"> (for scalar |
918 | assignment to C<undef>) | |
919 | ||
920 | Attempting to perform a scalar assignment to C<undef>, for example via | |
921 | C<undef = $foo;>, previously triggered a fatal runtime error with the | |
922 | message "L<Modification of a read-only value attempted|perldiag/"Modification of a read-only value attempted">." | |
923 | It is more helpful to detect such attempted assignments prior to runtime, so | |
924 | they are now compile time errors, resulting in the message "Can't modify undef | |
925 | operator in scalar assignment". | |
926 | ||
927 | =item * | |
928 | ||
a993f9e1 RS |
929 | L<panic: newFORLOOP, %s|perldiag/"panic: newFORLOOP, %s"> |
930 | ||
931 | The parser failed an internal consistency check while trying to parse | |
932 | a C<foreach> loop. | |
933 | ||
78684fb7 S |
934 | =back |
935 | ||
6acd8d81 SH |
936 | =head3 New Warnings |
937 | ||
938 | =over 4 | |
939 | ||
940 | =item * | |
941 | ||
d3948fc9 RS |
942 | L<Built-in function '%s' is experimental|perldiag/"Built-in function '%s' is experimental"> |
943 | ||
944 | A call is being made to a function in the C<builtin::> namespace, which is | |
945 | currently experimental. | |
946 | ||
947 | =item * | |
948 | ||
6fe03a92 RS |
949 | L<defer is experimental|perldiag/"defer is experimental"> |
950 | ||
d3948fc9 RS |
951 | The C<defer> block modifier is experimental. If you want to use the feature, |
952 | disable the warning with C<no warnings 'experimental::defer'>, but know that in | |
953 | doing so you are taking the risk that your code may break in a future Perl | |
954 | version. | |
6acd8d81 | 955 | |
a993f9e1 RS |
956 | =item * |
957 | ||
d3948fc9 | 958 | L<Downgrading a use VERSION declaration to below v5.11 is deprecated|perldiag/"Downgrading a use VERSION declaration to below v5.11 is deprecated"> |
a993f9e1 | 959 | |
d3948fc9 RS |
960 | This warning is emitted on a C<use VERSION> statement that |
961 | requests a version below v5.11 (when the effects of C<use strict> would be | |
962 | disabled), after a previous declaration of one having a larger number (which | |
963 | would have enabled these effects) | |
a993f9e1 | 964 | |
953a3553 RS |
965 | =item * |
966 | ||
d3948fc9 | 967 | L<for my (...) is experimental|perldiag/"for my (...) is experimental"> |
953a3553 | 968 | |
d3948fc9 RS |
969 | This warning is emitted if you use C<for> to iterate multiple values at |
970 | a time. This syntax is currently experimental and its behaviour may | |
971 | change in future releases of Perl. | |
953a3553 RS |
972 | |
973 | =item * | |
974 | ||
975 | L<Implicit use of @_ in %s with signatured subroutine is experimental|perldiag/"Implicit use of @_ in %s with signatured subroutine is experimental"> | |
976 | ||
977 | An expression that implicitly involves the C<@_> arguments array was found in | |
978 | a subroutine that uses a signature. | |
979 | ||
980 | =item * | |
981 | ||
982 | L<Use of @_ in %s with signatured subroutine is experimental|perldiag/"Use of @_ in %s with signatured subroutine is experimental"> | |
983 | ||
984 | An expression involving the C<@_> arguments array was found in a subroutine that uses a signature. | |
985 | ||
986 | =item * | |
987 | ||
8404d64a RS |
988 | L<Wide character in $0|perldiag/"Wide character in %s"> |
989 | ||
990 | Attempts to put wide characters into the program name (C<$0>) now provoke this | |
991 | warning. | |
992 | ||
6acd8d81 SH |
993 | =back |
994 | ||
995 | =head2 Changes to Existing Diagnostics | |
996 | ||
6acd8d81 SH |
997 | =over 4 |
998 | ||
999 | =item * | |
1000 | ||
d3948fc9 | 1001 | L<'E<sol>' does not take a repeat count in %s|perldiag/"'/' does not take a repeat count in %s"> |
6fe03a92 | 1002 | |
d3948fc9 | 1003 | This warning used to not include the C<in %s>. |
6fe03a92 | 1004 | |
d3948fc9 | 1005 | =item * |
a993f9e1 | 1006 | |
d3948fc9 RS |
1007 | L<Subroutine %s redefined|perldiag/"Subroutine %s redefined"> |
1008 | ||
1009 | Localized subroutine redefinitions no longer trigger this warning. | |
a993f9e1 | 1010 | |
6fe03a92 RS |
1011 | =item * |
1012 | ||
a5009f17 | 1013 | L<unexpected constant lvalue entersub entry via typeE<sol>targ %d:%d"|perldiag/"panic: unexpected constant lvalue entersub entry via type/targ %d:%d"> now has a panic prefix |
6fe03a92 | 1014 | |
d3948fc9 RS |
1015 | This makes it consistent with other checks of internal consistency when |
1016 | compiling a subroutine. | |
6acd8d81 | 1017 | |
953a3553 RS |
1018 | =item * |
1019 | ||
a5009f17 | 1020 | L<Useless use of sort in scalar context|perldiag/"Useless use of %s in scalar |
d3948fc9 | 1021 | context"> is now in the new C<scalar> category. |
953a3553 | 1022 | |
d3948fc9 RS |
1023 | When C<sort> is used in scalar context, it provokes a warning that doing this |
1024 | is not useful. This warning used to be in the C<void> category. A new category | |
1025 | for warnings about scalar context has now been added, called C<scalar>. | |
953a3553 | 1026 | |
8404d64a RS |
1027 | =item * |
1028 | ||
d3948fc9 | 1029 | Removed a number of diagnostics |
8404d64a | 1030 | |
d3948fc9 RS |
1031 | Many diagnostics that have been removed from the perl core across many years |
1032 | have now I<also> been removed from the documentation. | |
8404d64a | 1033 | |
6acd8d81 SH |
1034 | =back |
1035 | ||
6acd8d81 | 1036 | =head1 Configuration and Compilation |
2808c4d8 | 1037 | |
6acd8d81 SH |
1038 | =over 4 |
1039 | ||
1040 | =item * | |
1041 | ||
a993f9e1 RS |
1042 | The Perl C source code now uses some C99 features, which we have verified are |
1043 | supported by all compilers we target. This means that Perl's headers now | |
1044 | contain some code that is legal in C99 but not C89. | |
1045 | ||
1046 | This may cause problems for some XS modules that unconditionally add | |
1047 | C<-Werror=declaration-after-statement> to their C compiler flags if compiling | |
1048 | with gcc or clang. Earlier versions of Perl support long obsolete compilers | |
1049 | that are strict in rejecting certain C99 features, particularly mixed | |
1050 | declarations and code, and hence it makes sense for XS module authors to audit | |
1051 | that their code does not violate this. However, doing this is now only | |
1052 | possible on these earlier versions of Perl, hence these modules need to be | |
1053 | changed to only add this flag for C<<$] < 5.035005>>. | |
1054 | ||
1055 | =item * | |
1056 | ||
682feaf6 RS |
1057 | The makedepend step is now run in parallel by using make |
1058 | ||
8808da9a | 1059 | When using MAKEFLAGS=-j8, this significantly reduces the time required for: |
682feaf6 | 1060 | |
8808da9a | 1061 | sh ./makedepend MAKE=make cflags |
682feaf6 RS |
1062 | |
1063 | =item * | |
1064 | ||
1065 | F<Configure> now tests whether C<< #include <xlocale.h> >> is required | |
1066 | to use the POSIX 1003 thread-safe locale functions or some related | |
1067 | extensions. This prevents problems where a non-public F<xlocale.h> is | |
1068 | removed in a library update, or F<xlocale.h> isn't intended for public | |
1069 | use. (github L<#18936|https://github.com/Perl/perl5/pull/18936>) | |
1ee7332f | 1070 | |
d84985bf RB |
1071 | =back |
1072 | ||
78684fb7 | 1073 | =head1 Testing |
d9113277 | 1074 | |
6acd8d81 SH |
1075 | Tests were added and changed to reflect the other additions and changes |
1076 | in this release. | |
1077 | ||
6acd8d81 SH |
1078 | =head1 Platform Support |
1079 | ||
a993f9e1 | 1080 | =head2 Windows |
6acd8d81 | 1081 | |
a9ffe1fa RS |
1082 | =over 4 |
1083 | ||
1084 | =item * | |
1085 | ||
a993f9e1 RS |
1086 | Support for old MSVC++ (pre-VC12) has been removed |
1087 | ||
1088 | These did not support C99 and hence can no longer be used to compile perl. | |
1089 | ||
1090 | =item * | |
1091 | ||
b3d76e6f RS |
1092 | Support for compiling perl on Windows using Microsoft Visual Studio 2022 |
1093 | (containing Visual C++ 14.3) has been added. | |
1094 | ||
1095 | =item * | |
1096 | ||
a9ffe1fa RS |
1097 | The :win32 IO layer has been removed. This experimental replacement for the |
1098 | :unix layer never reached maturity in its nearly two decades of existence. | |
1099 | ||
1100 | =back | |
6acd8d81 | 1101 | |
6fe03a92 RS |
1102 | =head2 VMS |
1103 | ||
1104 | =over 4 | |
1105 | ||
1106 | =item C<keys %ENV> on VMS returns consistent results | |
1107 | ||
1108 | On VMS entries in the C<%ENV> hash are loaded from the OS environment on | |
1109 | first access, hence the first iteration of C<%ENV> requires the entire | |
1110 | environment to be scanned to find all possible keys. This initialisation had | |
1111 | always been done correctly for full iteration, but previously was not | |
1112 | happening for C<%ENV> in scalar context, meaning that C<scalar %ENV> would | |
1113 | return 0 if called before any other C<%ENV> access, or would only return the | |
1114 | count of keys accessed if there had been no iteration. | |
1115 | ||
1116 | These bugs are now fixed - C<%ENV> and C<keys %ENV> in scalar context now | |
1117 | return the correct result - the count of all keys in the environment. | |
1118 | ||
1119 | =back | |
1120 | ||
6acd8d81 SH |
1121 | =head2 Discontinued Platforms |
1122 | ||
6acd8d81 SH |
1123 | =over 4 |
1124 | ||
d2941388 RS |
1125 | =item AT&T UWIN |
1126 | ||
1127 | UWIN is a UNIX compatibility layer for Windows. It was last released | |
1128 | in 2012 and has been superseded by Cygwin these days. | |
1129 | ||
1130 | =item DOS/DJGPP | |
1131 | ||
1132 | DJGPP is a port of the GNU toolchain to 32-bit x86 systems running | |
1133 | DOS. The last known attempt to build Perl on it was on 5.20, which | |
1134 | only got as far as building miniperl. | |
1135 | ||
a993f9e1 | 1136 | =item NetWare |
6acd8d81 | 1137 | |
a993f9e1 RS |
1138 | Support code for Novell NetWare has been removed. NetWare was a |
1139 | server operating system by Novell. The port was last updated in July | |
1140 | 2002, and the platform itself in May 2009. | |
1141 | ||
1142 | Unrelated changes accidentally broke the build for the NetWare port in | |
1143 | September 2009, and in 12 years no-one has reported this. | |
6acd8d81 SH |
1144 | |
1145 | =back | |
1146 | ||
1147 | =head2 Platform-Specific Notes | |
1148 | ||
6acd8d81 SH |
1149 | =over 4 |
1150 | ||
0b53d7f5 | 1151 | =item z/OS |
6acd8d81 | 1152 | |
0b53d7f5 RS |
1153 | This update enables us to build EBCDIC static/dynamic and 31-bit/64-bit |
1154 | addressing mode Perl. The number of tests that pass is consistent with the | |
1155 | baseline before these updates. | |
1156 | ||
1157 | These changes also provide the base support to be able to provide ASCII | |
1158 | static/dynamic and 31-bit/64-bit addressing mode Perl. | |
6acd8d81 | 1159 | |
b3d76e6f RS |
1160 | The z/OS (previously called OS/390) README was updated to describe ASCII and |
1161 | EBCDIC builds. | |
1162 | ||
6acd8d81 SH |
1163 | =back |
1164 | ||
1165 | =head1 Internal Changes | |
1166 | ||
6acd8d81 SH |
1167 | =over 4 |
1168 | ||
1169 | =item * | |
1170 | ||
a2cea410 RS |
1171 | Since the removal of PERL_OBJECT in Perl 5.8, PERL_IMPLICIT_CONTEXT and |
1172 | MULTIPLICITY have been synonymous and they were being used interchangeably. | |
1173 | To simplify the code, all instances of PERL_IMPLICIT_CONTEXT have been | |
1174 | replaced with MULTIPLICITY. | |
1175 | ||
1176 | PERL_IMPLICIT_CONTEXT will remain defined for compatibility with XS modules. | |
6acd8d81 | 1177 | |
a9ffe1fa RS |
1178 | =item * |
1179 | ||
1180 | The API constant formerly named C<G_ARRAY>, indicating list context, has now | |
1181 | been renamed to a more accurate C<G_LIST>. A compatibilty macro C<G_ARRAY> has | |
1182 | been added to allow existing code to work unaffected. New code should be | |
1183 | written using the new constant instead. This is supported by C<Devel::PPPort> | |
1184 | version 3.63. | |
1185 | ||
682feaf6 RS |
1186 | =item * |
1187 | ||
1188 | Macros have been added to F<perl.h> to facilitate version comparisons: | |
1189 | C<PERL_GCC_VERSION_GE>, C<PERL_GCC_VERSION_GT>, C<PERL_GCC_VERSION_LE> and | |
1190 | C<PERL_GCC_VERSION_LT>. | |
1191 | ||
1192 | Inline functions have been added to F<embed.h> to determine the position of | |
1193 | the least significant 1 bit in a word: C<lsbit_pos32> and C<lsbit_pos64>. | |
1194 | ||
6fe03a92 RS |
1195 | =item * |
1196 | ||
1197 | C<Perl_ptr_table_clear> has been deleted. This has been marked as deprecated | |
1198 | since v5.14.0 (released in 2011), and is not used by any code on CPAN. | |
1199 | ||
1200 | =item * | |
1201 | ||
1202 | Added new boolean macros and functions. See L</Stable boolean tracking> for | |
1203 | related information and L<perlapi> for documentation. | |
1204 | ||
1205 | =over 4 | |
1206 | ||
1207 | =item * | |
1208 | ||
1209 | sv_setbool | |
1210 | ||
1211 | =item * | |
1212 | ||
1213 | sv_setbool_mg | |
1214 | ||
1215 | =item * | |
1216 | ||
1217 | SvIsBOOL | |
1218 | ||
1219 | =back | |
1220 | ||
1221 | =item * | |
1222 | ||
1223 | Added 4 missing functions for dealing with RVs: | |
1224 | ||
1225 | =over 4 | |
1226 | ||
1227 | =item * | |
1228 | ||
1229 | sv_setrv_noinc | |
1230 | ||
1231 | =item * | |
1232 | ||
1233 | sv_setrv_noinc_mg | |
1234 | ||
1235 | =item * | |
1236 | ||
1237 | sv_setrv_inc | |
1238 | ||
1239 | =item * | |
1240 | ||
1241 | sv_setrv_inc_mg | |
1242 | ||
1243 | =back | |
1244 | ||
1245 | =item * | |
1246 | ||
1247 | C<xs_handshake()>'s two failure modes now provide distinct messages. | |
1248 | ||
a993f9e1 RS |
1249 | =item * |
1250 | ||
1251 | Memory for hash iterator state (C<struct xpvhv_aux>) is now allocated as part | |
1252 | of the hash body, instead of as part of the block of memory allocated for the | |
1253 | main hash array. | |
1254 | ||
0b53d7f5 RS |
1255 | =item * |
1256 | ||
1257 | A new phase_name() interface provides access to the name for each interpreter | |
1258 | phase (i.e., PL_phase value). | |
1259 | ||
b3d76e6f RS |
1260 | =item * |
1261 | ||
1262 | The C<pack> behavior of C<U> has changed for EBCDIC. | |
1263 | ||
953a3553 RS |
1264 | =item * |
1265 | ||
1266 | New equality-test functions C<sv_numeq> and C<sv_streq> have been added, along | |
1267 | with C<..._flags>-suffixed variants. These expose a simple and consistent API | |
1268 | to perform numerical or string comparison which is aware of operator | |
1269 | overloading. | |
1270 | ||
1271 | =item * | |
1272 | ||
1273 | Reading the string form of an integer value no longer sets the flag C<SVf_POK>. | |
1274 | The string form is still cached internally, and still re-read directly by the | |
1275 | macros C<SvPV(sv)> I<etc> (inline, without calling a C function). XS code that | |
1276 | already calls the APIs to get values will not be affected by this change. XS | |
1277 | code that accesses flags directly instead of using API calls to express its | |
1278 | intent I<might> break, but such code likely is already buggy if passed some | |
1279 | other values, such as floating point values or objects with string overloading. | |
1280 | ||
1281 | This small change permits code (such as JSON serializers) to reliably determine | |
1282 | between | |
1283 | ||
1284 | =over 4 | |
1285 | ||
1286 | =item * | |
1287 | ||
1288 | a value that was initially B<written> as an integer, but then B<read> as a string | |
1289 | ||
1290 | my $answer = 42; | |
1291 | print "The answer is $answer\n"; | |
1292 | ||
1293 | =item * | |
1294 | ||
1295 | that same value that was initially B<written> as a string, but then B<read> as an integer | |
1296 | ||
1297 | my $answer = "42"; | |
1298 | print "That doesn't look right\n" | |
1299 | unless $answer == 6 * 9; | |
1300 | ||
1301 | =back | |
1302 | ||
1303 | For the first case (originally written as an integer), we now have: | |
1304 | ||
1305 | use Devel::Peek; | |
1306 | my $answer = 42; | |
1307 | Dump ($answer); | |
1308 | my $void = "$answer"; | |
1309 | print STDERR "\n"; | |
1310 | Dump($answer) | |
1311 | ||
1312 | ||
1313 | SV = IV(0x562538925778) at 0x562538925788 | |
1314 | REFCNT = 1 | |
1315 | FLAGS = (IOK,pIOK) | |
1316 | IV = 42 | |
1317 | ||
1318 | SV = PVIV(0x5625389263c0) at 0x562538925788 | |
1319 | REFCNT = 1 | |
1320 | FLAGS = (IOK,pIOK,pPOK) | |
1321 | IV = 42 | |
1322 | PV = 0x562538919b50 "42"\0 | |
1323 | CUR = 2 | |
1324 | LEN = 10 | |
1325 | ||
1326 | For the second (originally written as a string), we now have: | |
1327 | ||
1328 | use Devel::Peek; | |
1329 | my $answer = "42"; | |
1330 | Dump ($answer); | |
1331 | my $void = $answer == 6 * 9; | |
1332 | print STDERR "\n"; | |
1333 | Dump($answer)' | |
1334 | ||
1335 | ||
1336 | SV = PV(0x5586ffe9bfb0) at 0x5586ffec0788 | |
1337 | REFCNT = 1 | |
1338 | FLAGS = (POK,IsCOW,pPOK) | |
1339 | PV = 0x5586ffee7fd0 "42"\0 | |
1340 | CUR = 2 | |
1341 | LEN = 10 | |
1342 | COW_REFCNT = 1 | |
1343 | ||
1344 | SV = PVIV(0x5586ffec13c0) at 0x5586ffec0788 | |
1345 | REFCNT = 1 | |
1346 | FLAGS = (IOK,POK,IsCOW,pIOK,pPOK) | |
1347 | IV = 42 | |
1348 | PV = 0x5586ffee7fd0 "42"\0 | |
1349 | CUR = 2 | |
1350 | LEN = 10 | |
1351 | COW_REFCNT = 1 | |
1352 | ||
1353 | (One can't rely on the presence or absence of the flag C<SVf_IsCOW> to | |
1354 | determine the history of operations on a scalar.) | |
1355 | ||
1356 | Previously both cases would be indistinguishable, with all 4 flags set: | |
1357 | ||
1358 | SV = PVIV(0x55d4d62edaf0) at 0x55d4d62f0930 | |
1359 | REFCNT = 1 | |
1360 | FLAGS = (IOK,POK,pIOK,pPOK) | |
1361 | IV = 42 | |
1362 | PV = 0x55d4d62e1740 "42"\0 | |
1363 | CUR = 2 | |
1364 | LEN = 10 | |
1365 | ||
1366 | (and possibly C<SVf_IsCOW>, but not always) | |
1367 | ||
1368 | This now means that if XS code I<really> needs to determine which form a value | |
1369 | was first written as, it should implement logic roughly | |
1370 | ||
1371 | if (flags & SVf_IOK|SVf_NOK) && !(flags & SVf_POK) | |
1372 | serialize as number | |
1373 | else if (flags & SVf_POK) | |
1374 | serialize as string | |
1375 | else | |
1376 | the existing guesswork ... | |
1377 | ||
1378 | Note that this doesn't cover "dualvars" - scalars that report different | |
1379 | values when asked for their string form or number form (such as C<$!>). | |
1380 | Most serialization formats cannot represent such duplicity. | |
1381 | ||
1382 | I<The existing guesswork> remains because as well as dualvars, values might | |
1383 | be C<undef>, references, overloaded references, typeglobs and other things that | |
1384 | Perl itself can represent but do not map one-to-one into external formats, so | |
1385 | need some amount of approximation or encapsulation. | |
1386 | ||
8404d64a RS |
1387 | =item * |
1388 | ||
1389 | C<sv_dump> (and L<Devel::Peek>’s C<Dump> function) now escapes high-bit | |
1390 | octets in the PV as hex rather than octal. Since most folks understand hex | |
1391 | more readily than octal, this should make these dumps a bit more legible. | |
1392 | This does B<not> affect any other diagnostic interfaces like C<pv_display>. | |
1393 | ||
6acd8d81 | 1394 | =back |
123732b0 | 1395 | |
78684fb7 | 1396 | =head1 Selected Bug Fixes |
d84985bf | 1397 | |
78684fb7 S |
1398 | =over 4 |
1399 | ||
1400 | =item * | |
1401 | ||
a2cea410 | 1402 | utime() now correctly sets errno/C<$!> when called on a closed handle. |
6acd8d81 | 1403 | |
a9ffe1fa RS |
1404 | =item * |
1405 | ||
1406 | The flags on the OPTVAL parameter to setsockopt() were previously | |
1407 | checked before magic was called, possibly treating a numeric value as | |
1408 | a packed buffer or vice versa. It also ignored the UTF-8 flag, | |
1409 | potentially treating the internal representation of an upgraded SV as | |
1410 | the bytes to supply to the setsockopt() system call. (github L<#18660|https://github.com/Perl/perl5/issues/18660>) | |
1411 | ||
1412 | =item * | |
1413 | ||
1414 | Only set IOKp, not IOK on $) and $(. | |
1415 | This was issue L<#18955|https://github.com/Perl/perl5/issues/18955>: This will prevent serializers from serializing these | |
1416 | variables as numbers (which loses the additional groups). | |
1417 | This restores behaviour from 5.16 | |
1418 | ||
682feaf6 RS |
1419 | =item * |
1420 | ||
1421 | Use of the C<mktables> debugging facility would cause perl to croak since | |
1422 | v5.31.10; this problem has now been fixed. | |
1423 | ||
1424 | =item * | |
1425 | ||
1426 | C<makedepend> logic is now compatible with BSD make (fixes | |
1427 | L<GH #19046|https://github.com/Perl/perl5/issues/19046>). | |
1428 | ||
a993f9e1 RS |
1429 | =item * |
1430 | ||
1431 | Calling C<untie> on a tied hash that is partway through iteration now frees the | |
1432 | iteration state immediately. | |
1433 | ||
1434 | Iterating a tied hash causes perl to store a copy of the current hash key to | |
1435 | track the iteration state, with this stored copy passed as the second parameter | |
1436 | to C<NEXTKEY>. This internal state is freed immediately when tie hash iteration | |
1437 | completes, or if the hash is destroyed, but due to an implementation oversight, | |
1438 | it was not freed if the hash was untied. In that case, the internal copy of the | |
1439 | key would persist until the earliest of | |
1440 | ||
1441 | =over 4 | |
1442 | ||
1443 | =item 1 | |
1444 | ||
1445 | C<tie> was called again on the same hash | |
1446 | ||
1447 | =item 2 | |
1448 | ||
1449 | The (now untied) hash was iterated (ie passed to any of C<keys>, C<values> or | |
1450 | C<each>) | |
1451 | ||
1452 | =item 3 | |
1453 | ||
1454 | The hash was destroyed. | |
1455 | ||
1456 | =back | |
1457 | ||
1458 | This inconsistency is now fixed - the internal state is now freed immediately by | |
1459 | C<untie>. | |
1460 | ||
1461 | As the precise timing of this behaviour can be observed with pure Perl code | |
1462 | (the timing of C<DESTROY> on objects returned from C<FIRSTKEY> and C<NEXTKEY>) | |
1463 | it's just possible that some code is sensitive to it. | |
1464 | ||
1465 | =item * | |
1466 | ||
1467 | The C<Internals::getcwd()> function added for bootstrapping miniperl | |
1468 | in perl 5.30.0 is now only available in miniperl. [github #19122] | |
1469 | ||
d2941388 RS |
1470 | =item * |
1471 | ||
1472 | Setting a breakpoint on a BEGIN or equivalently a C<use> statement | |
1473 | could cause a memory write to a freed C<dbstate> op. | |
1474 | [L<GH #19198|https://github.com/Perl/perl5/issues/19198>] | |
1475 | ||
0b53d7f5 RS |
1476 | =item * |
1477 | ||
1478 | When bareword filehandles are disabled, the parser was interpreting | |
1479 | any bareword as a filehandle, even when immediatey followed by parens. | |
1480 | ||
6acd8d81 SH |
1481 | =back |
1482 | ||
6acd8d81 | 1483 | =head1 Errata From Previous Releases |
deaec9bf | 1484 | |
6acd8d81 | 1485 | =over 4 |
07b02967 | 1486 | |
6acd8d81 | 1487 | =item * |
07b02967 | 1488 | |
682feaf6 RS |
1489 | L<perl5300delta> mistakenly identified a CVE whose correct identification is |
1490 | CVE-2015-1592. | |
07b02967 | 1491 | |
6acd8d81 SH |
1492 | =back |
1493 | ||
d2941388 | 1494 | =head1 Obituaries |
07b02967 | 1495 | |
a2cea410 | 1496 | Raun "Spider" Boardman (SPIDB on CPAN), author of at least 66 commits to the |
d2941388 | 1497 | Perl 5 core distribution between 1996 and 2002, passed away May 24, 2021 from |
a2cea410 | 1498 | complications of COVID. He will be missed. |
6acd8d81 | 1499 | |
d2941388 RS |
1500 | David H. Adler (DHA) passed away on November 16, 2021. In 1997, David |
1501 | co-founded NY.pm, the first Perl user group, and in 1998 co-founded Perl | |
1502 | Mongers to help establish other user groups across the globe. He was a | |
1503 | frequent attendee at Perl conferences in both North America and Europe and well | |
1504 | known for his role in organizing I<Bad Movie Night> celebrations at those | |
1505 | conferences. He also contributed to the work of the Perl Foundation, including | |
1506 | administering the White Camel awards for community service. He will be missed. | |
1507 | ||
6acd8d81 | 1508 | =head1 Acknowledgements |
07b02967 | 1509 | |
93c1882f RS |
1510 | Perl 5.36.0 represents approximately a year of development since Perl |
1511 | 5.34.0 and contains approximately 250,000 lines of changes across 2,000 | |
1512 | files from 82 authors. | |
1513 | ||
1514 | Excluding auto-generated files, documentation and release tools, there were | |
1515 | approximately 190,000 lines of changes to 1,300 .pm, .t, .c and .h files. | |
1516 | ||
1517 | Perl continues to flourish into its fourth decade thanks to a vibrant | |
1518 | community of users and developers. The following people are known to have | |
1519 | contributed the improvements that became Perl 5.36.0: | |
1520 | ||
1521 | Alyssa Ross, Andrew Fresh, Aristotle Pagaltzis, Asher Mancinelli, Atsushi | |
1522 | Sugawara, Ben Cornett, Bernd, Biswapriyo Nath, Brad Barden, Bram, Branislav | |
1523 | Zahradník, brian d foy, Chad Granum, Chris 'BinGOs' Williams, Christian | |
1524 | Walde (Mithaldu), Christopher Yeleighton, Craig A. Berry, cuishuang, Curtis | |
1525 | Poe, Dagfinn Ilmari Mannsåker, Dan Book, Daniel Laügt, Dan Jacobson, Dan | |
1526 | Kogai, Dave Cross, Dave Lambley, David Cantrell, David Golden, David | |
1527 | Marshall, David Mitchell, E. Choroba, Eugen Konkov, Felipe Gasper, François | |
1528 | Perrad, Graham Knop, H.Merijn Brand, Hugo van der Sanden, Ilya Sashcheka, | |
1529 | Ivan Panchenko, Jakub Wilk, James E Keenan, James Raspass, Karen Etheridge, | |
1530 | Karl Williamson, Leam Hall, Leon Timmermans, Magnus Woldrich, Matthew | |
1531 | Horsfall, Max Maischein, Michael G Schwern, Michiel Beijen, Mike Fulton, | |
1532 | Neil Bowers, Nicholas Clark, Nicolas R, Niyas Sait, Olaf Alders, Paul Evans, | |
1533 | Paul Marquess, Petar-Kaleychev, Pete Houston, Renee Baecker, Ricardo Signes, | |
1534 | Richard Leach, Robert Rothenberg, Sawyer X, Scott Baker, Sergey Poznyakoff, | |
1535 | Sergey Zhmylove, Sisyphus, Slaven Rezic, Steve Hay, Sven Kirmess, TAKAI | |
1536 | Kousuke, Thibault Duponchelle, Todd Rinaldo, Tomasz Konojacki, Tomoyuki | |
1537 | Sadahiro, Tony Cook, Unicode Consortium, Yves Orton, Михаил | |
1538 | Козачков. | |
1539 | ||
1540 | The list above is almost certainly incomplete as it is automatically | |
1541 | generated from version control history. In particular, it does not include | |
1542 | the names of the (very much appreciated) contributors who reported issues to | |
1543 | the Perl bug tracker. | |
1544 | ||
1545 | Many of the changes included in this version originated in the CPAN modules | |
1546 | included in Perl's core. We're grateful to the entire CPAN community for | |
1547 | helping Perl to flourish. | |
1548 | ||
1549 | For a more complete list of all of Perl's historical contributors, please | |
8424e368 | 1550 | |
44691e6f AB |
1551 | =head1 Reporting Bugs |
1552 | ||
6acd8d81 SH |
1553 | If you find what you think is a bug, you might check the perl bug database |
1554 | at L<https://github.com/Perl/perl5/issues>. There may also be information at | |
46a21c0a | 1555 | L<http://www.perl.org/>, the Perl Home Page. |
44691e6f | 1556 | |
8166b4e0 | 1557 | If you believe you have an unreported bug, please open an issue at |
0382c61d | 1558 | L<https://github.com/Perl/perl5/issues>. Be sure to trim your bug down to a |
8166b4e0 | 1559 | tiny but sufficient test case. |
44691e6f | 1560 | |
87c118b9 | 1561 | If the bug you are reporting has security implications which make it |
8166b4e0 | 1562 | inappropriate to send to a public issue tracker, then see |
6acd8d81 SH |
1563 | L<perlsec/SECURITY VULNERABILITY CONTACT INFORMATION> |
1564 | for details of how to report the issue. | |
44691e6f | 1565 | |
390ae6f9 S |
1566 | =head1 Give Thanks |
1567 | ||
6acd8d81 SH |
1568 | If you wish to thank the Perl 5 Porters for the work we had done in Perl 5, |
1569 | you can do so by running the C<perlthanks> program: | |
390ae6f9 S |
1570 | |
1571 | perlthanks | |
1572 | ||
1573 | This will send an email to the Perl 5 Porters list with your show of thanks. | |
1574 | ||
44691e6f AB |
1575 | =head1 SEE ALSO |
1576 | ||
e08634c5 SH |
1577 | The F<Changes> file for an explanation of how to view exhaustive details on |
1578 | what changed. | |
44691e6f AB |
1579 | |
1580 | The F<INSTALL> file for how to build Perl. | |
1581 | ||
1582 | The F<README> file for general stuff. | |
1583 | ||
1584 | The F<Artistic> and F<Copying> files for copyright information. | |
1585 | ||
1586 | =cut |