Debian Codegraph @

upstream/debian-unstable/man1/perl5380delta.1

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "PERL5380DELTA 1"
58 .TH PERL5380DELTA 1 2025-11-16 "perl v5.40.1" "Perl Programmers Reference Guide"
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 perl5380delta \- what is new for perl v5.38.0
65 .SH DESCRIPTION
66 .IX Header "DESCRIPTION"
67 This document describes differences between the 5.36.0 release and the 5.38.0
68 release.
69 .SH "Core Enhancements"
70 .IX Header "Core Enhancements"
71 .ie n .SS "New ""class"" Feature"
72 .el .SS "New \f(CWclass\fP Feature"
73 .IX Subsection "New class Feature"
74 A new \fBexperimental\fR syntax is now available for defining object classes,
75 where per-instance data is stored in "field" variables that behave like
76 lexicals.
77 .PP
78 .Vb 1
79 \& use feature \*(Aqclass\*(Aq;
80 \&
81 \& class Point
82 \& {
83 \& field $x;
84 \& field $y;
85 \&
86 \& method zero { $x = $y = 0; }
87 \& }
88 .Ve
89 .PP
90 This is described in more detail in perlclass. Notes on the internals of
91 its implementation and other related details can be found in perlclassguts.
92 .PP
93 This remains a new and experimental feature, and is very much still under
94 development. It will be the subject of much further addition, refinement and
95 alteration in future releases. As it is experimental, it yields warnings in
96 the \f(CW\*(C`experimental::class\*(C'\fR category. These can be silenced by a
97 \&\f(CW\*(C`no warnings\*(C'\fR statement.
98 .PP
99 .Vb 2
100 \& use feature \*(Aqclass\*(Aq;
101 \& no warnings \*(Aqexperimental::class\*(Aq;
102 .Ve
103 .SS "Unicode 15.0 is supported"
104 .IX Subsection "Unicode 15.0 is supported"
105 See <https://www.unicode.org/versions/Unicode15.0.0/> for details.
106 .SS "Deprecation warnings now have specific subcategories"
107 .IX Subsection "Deprecation warnings now have specific subcategories"
108 All deprecation warnings now have their own specific deprecation category which
109 can be disabled individually. You can see a list of all deprecated features in
110 perldeprecation, and in warnings. The following list is from warnings:
111 .PP
112 .Vb 10
113 \& +\- deprecated \-\-\-\-+
114 \& | |
115 \& | +\- deprecated::apostrophe_as_package_separator
116 \& | |
117 \& | +\- deprecated::delimiter_will_be_paired
118 \& | |
119 \& | +\- deprecated::dot_in_inc
120 \& | |
121 \& | +\- deprecated::goto_construct
122 \& | |
123 \& | +\- deprecated::smartmatch
124 \& | |
125 \& | +\- deprecated::unicode_property_name
126 \& | |
127 \& | +\- deprecated::version_downgrade
128 .Ve
129 .PP
130 It is still possible to disable all deprecation warnings in a single
131 statement with
132 .PP
133 .Vb 1
134 \& no warnings \*(Aqdeprecated\*(Aq;
135 .Ve
136 .PP
137 but now is possible to have a finer grained control. As has historically been
138 the case these warnings are automatically enabled with
139 .PP
140 .Vb 1
141 \& use warnings;
142 .Ve
143 .SS "%{^HOOK} API introduced"
144 .IX Subsection "%{^HOOK} API introduced"
145 For various reasons it can be difficult to create subroutine wrappers
146 for some of perl's keywords. Any keyword which has an undefined
147 prototype simply cannot be wrapped with a subroutine, and some keywords
148 which perl permits to be wrapped are in practice very tricky to wrap.
149 For example \f(CW\*(C`require\*(C'\fR is tricky to wrap, it is possible but doing so
150 changes the stack depth, and the standard methods of exporting assume
151 that they will be exporting to a package at certain stack depth up the
152 stack, and the wrapper will thus change where functions are exported to
153 unless implemented with a great deal of care. This can be very awkward
154 to deal with.
155 .PP
156 Accordingly we have introduced a new hash called \f(CW\*(C`%{^HOOK}\*(C'\fR which is
157 intended to facilitate such cases. When a keyword supports any kind of
158 special hook then the hook will live in this new hash. Hooks in this
159 hash will be named after the function they are called by, followed by
160 two underbars and then the phase they are executed in, currently either
161 before or after the keyword is executed.
162 .PP
163 In this initial release we support two hooks \f(CW\*(C`require_\|_before\*(C'\fR and
164 \&\f(CW\*(C`require_\|_after\*(C'\fR. These are provided to make it easier to perform tasks
165 before and after a require statement.
166 .PP
167 See perlvar for more details.
168 .SS PERL_RAND_SEED
169 .IX Subsection "PERL_RAND_SEED"
170 Added a new environment variable \f(CW\*(C`PERL_RAND_SEED\*(C'\fR which can be used to
171 cause a perl program which uses \f(CW\*(C`rand\*(C'\fR without using \f(CWsrand()\fR
172 explicitly or which uses \f(CWsrand()\fR with no arguments to be repeatable.
173 See perlrun. This feature can be disabled at compile time by passing
174 .PP
175 .Vb 1
176 \& \-Accflags=\-DNO_PERL_RAND_SEED
177 .Ve
178 .PP
179 to \fIConfigure\fR during the build process.
180 .SS "Defined-or and logical-or assignment default expressions in signatures"
181 .IX Subsection "Defined-or and logical-or assignment default expressions in signatures"
182 The default expression for a subroutine signature parameter can now be
183 assigned using the \f(CW\*(C`//=\*(C'\fR or \f(CW\*(C`||=\*(C'\fR operators, to apply the defaults whenever
184 the caller provided an undefined or false value (respectively), rather than
185 simply when the parameter is missing entirely. For more detail see the
186 documentation in perlsub.
187 .ie n .SS "@INC Hook Enhancements and $INC and INCDIR"
188 .el .SS "\f(CW@INC\fP Hook Enhancements and \f(CW$INC\fP and INCDIR"
189 .IX Subsection "@INC Hook Enhancements and $INC and INCDIR"
190 The internals for \f(CW@INC\fR hooks have been hardened to handle various
191 edge cases and should no longer segfault or throw assert failures when
192 hooks modify \f(CW@INC\fR during a require operation. As part of this we
193 now ensure that any given hook is executed at most once during a require
194 call, and that any duplicate directories do not trigger additional
195 directory probes.
196 .PP
197 To provide developers more control over dynamic module lookup, a new hook
198 method \f(CW\*(C`INCDIR\*(C'\fR is now supported. An object supporting this method may be
199 injected into the \f(CW@INC\fR array, and when it is encountered in the module
200 search process it will be executed, just like how INC hooks are executed,
201 and its return value used as a list of directories to search for the
202 module. Returning an empty list acts as a no-op. Note that since any
203 references returned by this hook will be stringified and used as strings,
204 you may not return a hook to be executed later via this API.
205 .PP
206 When an \f(CW@INC\fR hook (either \f(CW\*(C`INC\*(C'\fR or \f(CW\*(C`INCDIR\*(C'\fR) is called during
207 require, the \f(CW$INC\fR variable will be localized to be the value of the
208 index of \f(CW@INC\fR that the hook came from. If the hook wishes to override
209 what the "next" index in \f(CW@INC\fR should be it may update \f(CW$INC\fR to be one
210 less than the desired index (\f(CW\*(C`undef\*(C'\fR is equivalent to \f(CW\-1\fR). This
211 allows an \f(CW@INC\fR hook to completely rewrite the \f(CW@INC\fR array and have
212 perl restart its directory probes from the beginning of \f(CW@INC\fR.
213 .PP
214 Blessed CODE references in \f(CW@INC\fR that do not support the \f(CW\*(C`INC\*(C'\fR or
215 \&\f(CW\*(C`INCDIR\*(C'\fR methods will no longer trigger an exception, and instead will
216 be treated the same as unblessed coderefs are, and executed as though
217 they were an \f(CW\*(C`INC\*(C'\fR hook.
218 .ie n .SS "Forbidden control flow out of ""defer"" or ""finally"" now detected at compile-time"
219 .el .SS "Forbidden control flow out of \f(CWdefer\fP or \f(CWfinally\fP now detected at compile-time"
220 .IX Subsection "Forbidden control flow out of defer or finally now detected at compile-time"
221 It is forbidden to attempt to leave a \f(CW\*(C`defer\*(C'\fR or \f(CW\*(C`finally\*(C'\fR block by means
222 of control flow such as \f(CW\*(C`return\*(C'\fR or \f(CW\*(C`goto\*(C'\fR. Previous versions of perl could
223 only detect this when actually attempted at runtime.
224 .PP
225 This version of perl adds compile-time detection for many cases that can be
226 statically determined. This may mean that code which compiled successfully on
227 a previous version of perl is now reported as a compile-time error with this
228 one. This only happens in cases where it would have been an error to actually
229 execute the code anyway; the error simply happens at an earlier time.
230 .SS "Optimistic Eval in Patterns"
231 .IX Subsection "Optimistic Eval in Patterns"
232 The use of \f(CW\*(C`(?{ ... })\*(C'\fR and \f(CW\*(C`(??{ ... })\*(C'\fR in a pattern disables various
233 optimisations globally in that pattern. This may or may not be desired by the
234 programmer. This release adds the \f(CW\*(C`(*{ ... })\*(C'\fR
235 equivalent. The only difference is that it does not and will never disable
236 any optimisations in the regex engine. This may make it more unstable in the
237 sense that it may be called more or less times in the future, however the
238 number of times it executes will truly match how the regex engine functions.
239 For example, certain types of optimisation are disabled when \f(CW\*(C`(?{ ... })\*(C'\fR is
240 included in a pattern, so that patterns which are O(N) in normal use become
241 O(N*N) with a \f(CW\*(C`(?{ ... })\*(C'\fR pattern in them. Switching to \f(CW\*(C`(*{ ... })\*(C'\fR means
242 the pattern will stay O(N).
243 .SS "REG_INF has been raised from 65,536 to 2,147,483,647"
244 .IX Subsection "REG_INF has been raised from 65,536 to 2,147,483,647"
245 Many regex quantifiers used to be limited to \f(CW\*(C`U16_MAX\*(C'\fR in the past, but are
246 now limited to \f(CW\*(C`I32_MAX\*(C'\fR, thus it is now possible to write
247 \&\f(CW\*(C`/(?:word){1000000}/\*(C'\fR for example. Note that doing so may cause the regex
248 engine to run longer and use more memory.
249 .SS "New API functions optimize_optree and finalize_optree"
250 .IX Subsection "New API functions optimize_optree and finalize_optree"
251 There are two new API functions for operating on optree fragments, ensuring
252 you can invoke the required parts of the optree-generation process that might
253 otherwise not get invoked (e.g. when creating a custom LOGOP). To get access
254 to these functions, you first need to set a \f(CW\*(C`#define\*(C'\fR to opt-in to using
255 these functions.
256 .PP
257 .Vb 1
258 \& #define PERL_USE_VOLATILE_API
259 .Ve
260 .PP
261 These functions are closely tied to the internals of how the interpreter
262 works, and could be altered or removed at any time if other internal changes
263 make that necessary.
264 .ie n .SS "Some ""goto""s are now permitted in ""defer"" and ""finally"" blocks"
265 .el .SS "Some \f(CWgoto\fPs are now permitted in \f(CWdefer\fP and \f(CWfinally\fP blocks"
266 .IX Subsection "Some gotos are now permitted in defer and finally blocks"
267 Perl version 5.36.0 added \f(CW\*(C`defer\*(C'\fR blocks and permitted the \f(CW\*(C`finally\*(C'\fR keyword
268 to also add similar behaviour to \f(CW\*(C`try\*(C'\fR/\f(CW\*(C`catch\*(C'\fR syntax. These did not permit
269 any \f(CW\*(C`goto\*(C'\fR expression within the body, as it could have caused control flow
270 to jump out of the block. Now, some \f(CW\*(C`goto\*(C'\fR expressions are allowed, if they
271 have a constant target label, and that label is found within the block.
272 .PP
273 .Vb 1
274 \& use feature \*(Aqdefer\*(Aq;
275 \&
276 \& defer {
277 \& goto LABEL;
278 \& print "This does not execute\en";
279 \& LABEL: print "This does\en";
280 \& }
281 .Ve
282 .SS "New regexp variable ${^LAST_SUCCESSFUL_PATTERN}"
283 .IX Subsection "New regexp variable ${^LAST_SUCCESSFUL_PATTERN}"
284 This allows access to the last succesful pattern that matched in the current
285 scope. Many aspects of the regex engine refer to the "last successful
286 pattern". The empty pattern reuses it, and all of the magic regex vars relate
287 to it. This allows access to its pattern. The following code
288 .PP
289 .Vb 3
290 \& if (m/foo/ || m/bar/) {
291 \& s//PQR/;
292 \& }
293 .Ve
294 .PP
295 can be rewritten as follows
296 .PP
297 .Vb 3
298 \& if (m/foo/ || m/bar/) {
299 \& s/${^LAST_SUCCESSFUL_PATTERN}/PQR/;
300 \& }
301 .Ve
302 .PP
303 and it will do the exactly same thing.
304 .SS "Locale category LC_NAME now supported on participating platforms"
305 .IX Subsection "Locale category LC_NAME now supported on participating platforms"
306 On platforms that have the GNU extension \f(CW\*(C`LC_NAME\*(C'\fR category, you may now use
307 it as the category parameter to "setlocale" in POSIX to set and query its locale.
308 .SH "Incompatible Changes"
309 .IX Header "Incompatible Changes"
310 .SS "\fBreadline()\fP no longer clears the stream error and eof flags"
311 .IX Subsection "readline() no longer clears the stream error and eof flags"
312 \&\f(CWreadline()\fR, also spelled \f(CW\*(C`<>\*(C'\fR, would clear the handle's error
313 and eof flags after an error occurred on the stream.
314 .PP
315 In nearly all cases this clear is no longer done, so the error and
316 eof flags now properly reflect the status of the stream after
317 \&\fBreadline()\fR.
318 .PP
319 Since the error flag is no longer cleared calling \fBclose()\fR on the
320 stream may fail and if the stream was not explicitly closed, the
321 implicit close of the stream may produce a warning.
322 .PP
323 This has resulted in two main types of problems in downstream CPAN
324 modules, and these may also occur in your code:
325 .IP \(bu 4
326 If your code reads to end of file, and then rebinds the handle to a
327 new file descriptor, previously since the eof flag wasn't set you
328 could continue to read from the stream. You now need to clear the eof
329 flag yourself with \f(CW\*(C`$handle\->clearerr()\*(C'\fR to continue reading.
330 .IP \(bu 4
331 If your code encounters an error on the stream while reading with
332 \&\fBreadline()\fR you will need to call \f(CW\*(C`$handle\->clearerr\*(C'\fR to continue
333 reading. The one case this occurred the underlying file descriptor was
334 marked non-blocking, so the \fBread()\fR system call was failing with
335 \&\f(CW\*(C`EAGAIN\*(C'\fR, which resulted in the error flag being set on the stream.
336 .PP
337 The only case where error and eof flags continue to cleared on
338 error is when reading from the child process for \fBglob()\fR in
339 \&\fIminiperl\fR. This allows it to correctly report errors from the child
340 process on \fBclose()\fR. This is unlikely to be an issue during normal
341 perl development.
342 .PP
343 [GH #20060 <https://github.com/Perl/perl5/issues/20060>]
344 .ie n .SS """INIT"" blocks no longer run after an exit() in ""BEGIN"""
345 .el .SS "\f(CWINIT\fP blocks no longer run after an \f(CWexit()\fP in \f(CWBEGIN\fP"
346 .IX Subsection "INIT blocks no longer run after an exit() in BEGIN"
347 \&\f(CW\*(C`INIT\*(C'\fR blocks will no longer run after an \f(CWexit()\fR performed inside of
348 a \f(CW\*(C`BEGIN\*(C'\fR. This means that the combination of the \f(CW\*(C`\-v\*(C'\fR option and the
349 \&\f(CW\*(C`\-c\*(C'\fR option no longer executes a compile check as well as showing the
350 perl version. The \f(CW\*(C`\-v\*(C'\fR option executes an \fBexit\fR\|(0) after printing the
351 version information inside of a \f(CW\*(C`BEGIN\*(C'\fR block, and the \f(CW\*(C`\-c\*(C'\fR check is
352 implemented by using \f(CW\*(C`INIT\*(C'\fR hooks, resulting in the \f(CW\*(C`\-v\*(C'\fR option taking
353 precedence.
354 .PP
355 [GH #1537 <https://github.com/Perl/perl5/issues/1537>]
356 [GH #20181 <https://github.com/Perl/perl5/issues/20181>]
357 .SS "Syntax errors no longer produce ""phantom error messages"""
358 .IX Subsection "Syntax errors no longer produce ""phantom error messages"""
359 Generally perl will continue parsing the source code even after
360 encountering a compile error. In many cases this is helpful, for
361 instance with misspelled variable names it is helpful to show as many
362 examples of the error as possible. But in the case of syntax errors
363 continuing often produces bizarre error messages and may even cause
364 segmentation faults during the compile process. In this release the
365 compiler will halt at the first syntax error encountered. This means
366 that any code expecting to see the specific error messages we used to
367 produce will be broken. The error that is emitted will be one of the
368 diagnostics that used to be produced, but in some cases some messages
369 that used to be produced will no longer be displayed.
370 .PP
371 See "Changes to Existing Diagnostics" for more details.
372 .ie n .SS utf8::upgrade()
373 .el .SS \f(CWutf8::upgrade()\fP
374 .IX Subsection "utf8::upgrade()"
375 Starting in this release, if the input string is \f(CW\*(C`undef\*(C'\fR, it remains
376 \&\f(CW\*(C`undef\*(C'\fR. Previously it would be changed into a defined, zero-length
377 string.
378 .SS "Changes to ""thread-safe"" locales"
379 .IX Subsection "Changes to ""thread-safe"" locales"
380 Perl 5.28 introduced "thread-safe" locales on systems that supported
381 them, namely modern Windows, and systems supporting POSIX 2008 locale
382 operations. These systems accomplish this by having per-thread locales,
383 while continuing to support the older global locale operations for code
384 that doesn't take the steps necessary to use the newer per-thread ones.
385 .PP
386 It turns out that some POSIX 2008 platforms have or have had buggy
387 implementations, which forced perl to not use them. The
388 \&\f(CW\*(C`${^SAFE_LOCALES}\*(C'\fR scalar variable contains 0 or 1 to indicate whether
389 or not the current platform is considered by perl to have a working
390 thread-safe implementation. Some implementations have been fixed
391 already, but FreeBSD and Cygwin have been newly discovered to be
392 sufficiently buggy that the thread-safe operations are no longer used by
393 perl, starting in this release. Hence, \f(CW\*(C`${^SAFE_LOCALES}\*(C'\fR is now 0 for
394 them. Older versions of perl can be configured to avoid these buggy
395 implementations by adding the \fIConfigure\fR option
396 \&\f(CW\*(C`\-DNO_POSIX_2008_LOCALE\*(C'\fR.
397 .PP
398 And v5.38 fixes a bug in all previous perls that led to locales not
399 being fully thread-safe. The first thread that finishes caused
400 the main thread (named \f(CW\*(C`thread0\*(C'\fR) to revert to the global locale in
401 effect at startup, discarding whatever the thread's locale had been
402 previously set to. If any other thread had switched to the global
403 locale by calling \f(CWswitch_to_global_locale()\fR in XS code, those threads
404 would all share the global locale, and \f(CW\*(C`thread0\*(C'\fR would not be
405 thread-safe.
406 .SH Deprecations
407 .IX Header "Deprecations"
408 .ie n .SS "Use of ""\*(Aq"" as a package name separator is deprecated"
409 .el .SS "Use of \f(CW\*(Aq\fP as a package name separator is deprecated"
410 .IX Subsection "Use of as a package name separator is deprecated"
411 Using \f(CW\*(C`\*(Aq\*(C'\fR as package separator in a variable named in a double-quoted
412 string has warned since 5.28. It is now deprecated in both string
413 interpolation and non-interpolated contexts, and will be removed in
414 Perl 5.42.
415 .SS "Switch and Smart Match operator"
416 .IX Subsection "Switch and Smart Match operator"
417 The "switch" feature and the smartmatch operator, \f(CW\*(C`~~\*(C'\fR, were introduced in
418 v5.10. Their behavior was significantly changed in v5.10.1. When the
419 "experiment" system was added in v5.18.0, switch and smartmatch were
420 retroactively declared experimental. Over the years, proposals to fix or
421 supplement the features have come and gone.
422 .PP
423 In v5.38.0, we are declaring the experiment a failure. Some future system may
424 take the conceptual place of smartmatch, but it has not yet been designed or
425 built.
426 .PP
427 These features will be entirely removed from perl in v5.42.0.
428 .SH "Performance Enhancements"
429 .IX Header "Performance Enhancements"
430 .IP \(bu 4
431 Additional optree optimizations for common OP patterns. For example, multiple
432 simple OPs replaced by a single streamlined OP, so as to be more efficient at
433 runtime. [GH #19943 <https://github.com/Perl/perl5/pull/19943>],
434 [GH #20063 <https://github.com/Perl/perl5/pull/20063>],
435 [GH #20077 <https://github.com/Perl/perl5/pull/20077>].
436 .IP \(bu 4
437 Creating an anonymous sub no longer generates an \f(CW\*(C`srefgen\*(C'\fR op, the
438 reference generation is now done in the \f(CW\*(C`anoncode\*(C'\fR or \f(CW\*(C`anonconst\*(C'\fR
439 op, saving runtime. [GH #20290 <https://github.com/Perl/perl5/pull/20290>]
440 .SH "Modules and Pragmata"
441 .IX Header "Modules and Pragmata"
442 .SS "Updated Modules and Pragmata"
443 .IX Subsection "Updated Modules and Pragmata"
444 .IP \(bu 4
445 Added the \f(CWis_tainted()\fR builtin function. [GH #19854 <https://github.com/Perl/perl5/issues/19854>]
446 .IP \(bu 4
447 Added the \f(CWexport_lexically()\fR builtin function as per PPC 0020 <https://github.com/Perl/PPCs/blob/main/ppcs/ppc0020-lexical-export.md>. [GH #19895 <https://github.com/Perl/perl5/issues/19895>]
448 .IP \(bu 4
449 Support for PPC 0018 <https://github.com/Perl/PPCs/blob/main/ppcs/ppc0018-module-true.md>, \f(CW\*(C`use feature "module_true";\*(C'\fR has been added to
450 the default feature bundle for v5.38 and later. It may also be used
451 explicitly. When enabled inside of a module the module does not need
452 to return true explicitly, and in fact the return will be forced to
453 a simple true value regardless of what it originally was.
454 .IP \(bu 4
455 Attribute::Handlers has been upgraded from version 1.02 to 1.03.
456 .IP \(bu 4
457 attributes has been upgraded from version 0.34 to 0.35.
458 .IP \(bu 4
459 autodie has been upgraded from version 2.34 to 2.36.
460 .IP \(bu 4
461 B has been upgraded from version 1.83 to 1.88.
462 .IP \(bu 4
463 B::Concise has been upgraded from version 1.006 to 1.007.
464 .IP \(bu 4
465 B::Deparse has been upgraded from version 1.64 to 1.74.
466 .IP \(bu 4
467 Benchmark has been upgraded from version 1.23 to 1.24.
468 .IP \(bu 4
469 bignum has been upgraded from version 0.65 to 0.66.
470 .IP \(bu 4
471 Carp has been upgraded from version 1.52 to 1.54.
472 .IP \(bu 4
473 Class::Struct has been upgraded from version 0.66 to 0.68.
474 .IP \(bu 4
475 Compress::Raw::Bzip2 has been upgraded from version 2.103 to 2.204_001.
476 .IP \(bu 4
477 Compress::Raw::Zlib has been upgraded from version 2.105 to 2.204_001.
478 .IP \(bu 4
479 Config::Perl::V has been upgraded from version 0.33 to 0.36.
480 .IP \(bu 4
481 CPAN has been upgraded from version 2.33 to 2.36.
482 .IP \(bu 4
483 Data::Dumper has been upgraded from version 2.184 to 2.188.
484 .IP \(bu 4
485 DB_File has been upgraded from version 1.857 to 1.858.
486 .IP \(bu 4
487 Devel::Peek has been upgraded from version 1.32 to 1.33.
488 .IP \(bu 4
489 Devel::PPPort has been upgraded from version 3.68 to 3.71.
490 .IP \(bu 4
491 Digest::MD5 has been upgraded from version 2.58 to 2.58_01.
492 .IP \(bu 4
493 Digest::SHA has been upgraded from version 6.02 to 6.04.
494 .IP \(bu 4
495 DynaLoader has been upgraded from version 1.52 to 1.54.
496 .IP \(bu 4
497 Encode has been upgraded from version 3.17 to 3.19.
498 .IP \(bu 4
499 encoding::warnings has been upgraded from version 0.13 to 0.14.
500 .IP \(bu 4
501 Env has been upgraded from version 1.05 to 1.06.
502 .IP \(bu 4
503 Errno has been upgraded from version 1.36 to 1.37.
504 .IP \(bu 4
505 experimental has been upgraded from version 0.028 to 0.031.
506 .IP \(bu 4
507 ExtUtils::CBuilder has been upgraded from version 0.280236 to 0.280238.
508 .IP \(bu 4
509 ExtUtils::Install has been upgraded from version 2.20 to 2.22.
510 .IP \(bu 4
511 ExtUtils::MakeMaker has been upgraded from version 7.64 to 7.70.
512 .IP \(bu 4
513 ExtUtils::Miniperl has been upgraded from version 1.11 to 1.13.
514 .IP \(bu 4
515 ExtUtils::ParseXS has been upgraded from version 3.45 to 3.51.
516 .IP \(bu 4
517 ExtUtils::PL2Bat has been upgraded from version 0.004 to 0.005.
518 .IP \(bu 4
519 ExtUtils::Typemaps has been upgraded from version 3.45 to 3.51.
520 .IP \(bu 4
521 feature has been upgraded from version 1.72 to 1.82.
522 .IP \(bu 4
523 File::Basename has been upgraded from version 2.85 to 2.86.
524 .IP \(bu 4
525 File::Copy has been upgraded from version 2.39 to 2.41.
526 .IP \(bu 4
527 File::Find has been upgraded from version 1.40 to 1.43.
528 .IP \(bu 4
529 File::Glob has been upgraded from version 1.37 to 1.40.
530 .IP \(bu 4
531 File::Spec has been upgraded from version 3.84 to 3.89.
532 .IP \(bu 4
533 File::stat has been upgraded from version 1.12 to 1.13.
534 .IP \(bu 4
535 FileHandle has been upgraded from version 2.03 to 2.05.
536 .IP \(bu 4
537 Filter::Util::Call has been upgraded from version 1.60 to 1.64.
538 .IP \(bu 4
539 GDBM_File has been upgraded from version 1.23 to 1.24.
540 .IP \(bu 4
541 Getopt::Long has been upgraded from version 2.52 to 2.54.
542 .IP \(bu 4
543 Hash::Util has been upgraded from version 0.28 to 0.30.
544 .IP \(bu 4
545 HTTP::Tiny has been upgraded from version 0.080 to 0.083.
546 .IP \(bu 4
547 I18N::Langinfo has been upgraded from version 0.21 to 0.22.
548 .IP \(bu 4
549 IO has been upgraded from version 1.50 to 1.52.
550 .IP \(bu 4
551 IO-Compress has been upgraded from version 2.106 to 2.204.
552 .IP \(bu 4
553 IO::Socket::IP has been upgraded from version 0.41 to 0.41_01.
554 .Sp
555 On DragonflyBSD, detect \fBsetsockopt()\fR not actually clearing
556 \&\f(CW\*(C`IPV6_V6ONLY\*(C'\fR even when \fBsetsockopt()\fR returns success. [cpan
557 #148293 <https://rt.cpan.org/Ticket/Display.html?id=148293>]
558 .IP \(bu 4
559 IO::Zlib has been upgraded from version 1.11 to 1.14.
560 .IP \(bu 4
561 JSON::PP has been upgraded from version 4.07 to 4.16.
562 .IP \(bu 4
563 libnet has been upgraded from version 3.14 to 3.15.
564 .IP \(bu 4
565 Locale::Maketext has been upgraded from version 1.31 to 1.33.
566 .IP \(bu 4
567 Math::BigInt has been upgraded from version 1.999830 to 1.999837.
568 .IP \(bu 4
569 Math::BigInt::FastCalc has been upgraded from version 0.5012 to 0.5013.
570 .IP \(bu 4
571 Math::BigRat has been upgraded from version 0.2621 to 0.2624.
572 .IP \(bu 4
573 Math::Complex has been upgraded from version 1.5902 to 1.62.
574 .IP \(bu 4
575 Memoize has been upgraded from version 1.03_01 to 1.16.
576 .IP \(bu 4
577 MIME::Base64 has been upgraded from version 3.16 to 3.16_01.
578 .IP \(bu 4
579 Module::CoreList has been upgraded from version 5.20220520 to 5.20230520.
580 .IP \(bu 4
581 mro has been upgraded from version 1.26 to 1.28.
582 .IP \(bu 4
583 NDBM_File has been upgraded from version 1.15 to 1.16.
584 .IP \(bu 4
585 Net::Ping has been upgraded from version 2.74 to 2.76.
586 .IP \(bu 4
587 ODBM_File has been upgraded from version 1.17 to 1.18.
588 .IP \(bu 4
589 Opcode has been upgraded from version 1.57 to 1.64.
590 .IP \(bu 4
591 overload has been upgraded from version 1.35 to 1.37.
592 .IP \(bu 4
593 parent has been upgraded from version 0.238 to 0.241.
594 .IP \(bu 4
595 PerlIO::via::QuotedPrint has been upgraded from version 0.09 to 0.10.
596 .IP \(bu 4
597 Pod::Checker has been upgraded from version 1.74 to 1.75.
598 .IP \(bu 4
599 Pod::Html has been upgraded from version 1.33 to 1.34.
600 .IP \(bu 4
601 Pod::Usage has been upgraded from version 2.01 to 2.03.
602 .IP \(bu 4
603 podlators has been upgraded from version 4.14 to 5.01.
604 .IP \(bu 4
605 POSIX has been upgraded from version 2.03 to 2.13.
606 .IP \(bu 4
607 re has been upgraded from version 0.43 to 0.44.
608 .IP \(bu 4
609 Safe has been upgraded from version 2.43 to 2.44.
610 .IP \(bu 4
611 Scalar::Util has been upgraded from version 1.62 to 1.63.
612 .IP \(bu 4
613 SDBM_File has been upgraded from version 1.15 to 1.17.
614 .IP \(bu 4
615 Socket has been upgraded from version 2.033 to 2.036.
616 .IP \(bu 4
617 Storable has been upgraded from version 3.26 to 3.32.
618 .IP \(bu 4
619 Sys::Hostname has been upgraded from version 1.24 to 1.25.
620 .IP \(bu 4
621 Term::Cap has been upgraded from version 1.17 to 1.18.
622 .IP \(bu 4
623 Test::Simple has been upgraded from version 1.302190 to 1.302194.
624 .IP \(bu 4
625 Text::Balanced has been upgraded from version 2.04 to 2.06.
626 .IP \(bu 4
627 threads has been upgraded from version 2.27 to 2.36.
628 .IP \(bu 4
629 threads::shared has been upgraded from version 1.64 to 1.68.
630 .IP \(bu 4
631 Tie::File has been upgraded from version 1.06 to 1.07.
632 .IP \(bu 4
633 Time::HiRes has been upgraded from version 1.9770 to 1.9775.
634 .IP \(bu 4
635 Time::Piece has been upgraded from version 1.3401 to 1.3401_01.
636 .IP \(bu 4
637 Unicode::Normalize has been upgraded from version 1.31 to 1.32.
638 .IP \(bu 4
639 UNIVERSAL has been upgraded from version 1.14 to 1.15.
640 .IP \(bu 4
641 User::grent has been upgraded from version 1.03 to 1.04.
642 .IP \(bu 4
643 User::pwent has been upgraded from version 1.01 to 1.02.
644 .IP \(bu 4
645 utf8 has been upgraded from version 1.24 to 1.25.
646 .IP \(bu 4
647 warnings has been upgraded from version 1.58 to 1.65.
648 .IP \(bu 4
649 XS::APItest has been upgraded from version 1.22 to 1.32.
650 .IP \(bu 4
651 XSLoader has been upgraded from version 0.31 to 0.32.
652 .SH Documentation
653 .IX Header "Documentation"
654 .SS "New Documentation"
655 .IX Subsection "New Documentation"
656 \fIperlclass\fR
657 .IX Subsection "perlclass"
658 .PP
659 Describes the new \f(CW\*(C`class\*(C'\fR feature.
660 .PP
661 \fIperlclassguts\fR
662 .IX Subsection "perlclassguts"
663 .PP
664 Describes the internals of the new \f(CW\*(C`class\*(C'\fR feature.
665 .SS "Changes to Existing Documentation"
666 .IX Subsection "Changes to Existing Documentation"
667 We have attempted to update the documentation to reflect the changes
668 listed in this document. If you find any we have missed, open an issue
669 at <https://github.com/Perl/perl5/issues>.
670 .PP
671 Additionally, the following selected changes have been made:
672 .PP
673 \fIperlapi\fR
674 .IX Subsection "perlapi"
675 .IP \(bu 4
676 Documented \f(CW\*(C`hv_ksplit\*(C'\fR
677 .IP \(bu 4
678 Documented \f(CW\*(C`hv_name_set\*(C'\fR
679 .IP \(bu 4
680 \&\f(CW\*(C`hv_store\*(C'\fR and \f(CW\*(C`hv_stores\*(C'\fR
681 documentation have been greatly improved.
682 .IP \(bu 4
683 Documented \f(CW\*(C`gv_autoload_pv\*(C'\fR
684 .IP \(bu 4
685 Documented \f(CW\*(C`gv_autoload_pvn\*(C'\fR
686 .IP \(bu 4
687 Documented \f(CW\*(C`gv_autoload_sv\*(C'\fR
688 .IP \(bu 4
689 Documented \f(CW\*(C`gv_name_set\*(C'\fR
690 .IP \(bu 4
691 Documented \f(CW\*(C`start_subparse\*(C'\fR
692 .IP \(bu 4
693 Documented \f(CW\*(C`SV_CHECK_THINKFIRST_COW_DROP\*(C'\fR
694 .IP \(bu 4
695 Documented \f(CW\*(C`SV_CHECK_THINKFIRST\*(C'\fR
696 .IP \(bu 4
697 Documented \f(CW\*(C`SvPV_shrink_to_cur\*(C'\fR
698 .IP \(bu 4
699 Documented \f(CW\*(C`save_aelem\*(C'\fR
700 .IP \(bu 4
701 Documented \f(CW\*(C`save_aelem_flags\*(C'\fR
702 .IP \(bu 4
703 Documented \f(CW\*(C`save_helem\*(C'\fR
704 .IP \(bu 4
705 Documented \f(CW\*(C`save_helem_flags\*(C'\fR
706 .PP
707 \fIperldeprecation\fR
708 .IX Subsection "perldeprecation"
709 .IP \(bu 4
710 Added information about unscheduled deprecations and their categories.
711 .IP \(bu 4
712 Added category information for existing scheduled deprecations.
713 .IP \(bu 4
714 Added smartmatch and apostrophe as a package separator deprecation data.
715 .PP
716 \fIperlintern\fR
717 .IX Subsection "perlintern"
718 .IP \(bu 4
719 Documented \f(CW\*(C`save_pushptr\*(C'\fR
720 .IP \(bu 4
721 Documented \f(CW\*(C`save_scalar_at\*(C'\fR
722 .IP \(bu 4
723 Entries have been added to perlguts for the new \f(CW\*(C`newAV_alloc_x\*(C'\fR, \f(CW\*(C`newAV_alloc_xz\*(C'\fR and
724 \&\f(CW*_simple\fR functions.
725 .IP \(bu 4
726 References to the now-defunct PrePAN service have been removed from
727 perlcommunity and perlmodstyle.
728 .IP \(bu 4
729 A section on symbol naming has been added to perlhacktips.
730 .IP \(bu 4
731 perlexperiment has been edited to properly reference the warning categories
732 for the defer block modifier and extra paired delimiters for quote-like
733 operators.
734 .PP
735 \fIperlexperiment\fR
736 .IX Subsection "perlexperiment"
737 .IP \(bu 4
738 Smartmatch has been moved from experimental status to deprecated status.
739 Unfortunately the experiment did not work out.
740 .PP
741 \fIperlfunc\fR
742 .IX Subsection "perlfunc"
743 .IP \(bu 4
744 Some wording improvements have been made for the \f(CW\*(C`ucfirst\*(C'\fR, \f(CW\*(C`push\*(C'\fR,
745 \&\f(CW\*(C`unshift\*(C'\fR and \f(CW\*(C`bless\*(C'\fR functions, as well as additional examples added.
746 .PP
747 \fIperlhacktips\fR
748 .IX Subsection "perlhacktips"
749 .IP \(bu 4
750 A new section, "Writing safer macros" in perlhacktips has been added to discuss
751 pitfalls and solutions to using C macros in C and XS code.
752 .IP \(bu 4
753 A new section, "Choosing good symbol names" in perlhacktips, has been added to
754 discuss unexpected gotchas with names.
755 .PP
756 \fIperlop\fR
757 .IX Subsection "perlop"
758 .IP \(bu 4
759 Document the behavior of matching the empty pattern better and specify
760 its relationship to the new \f(CW\*(C`${^LAST_SUCCESSFUL_PATTERN}\*(C'\fR properly.
761 .PP
762 \fIperlvar\fR
763 .IX Subsection "perlvar"
764 .IP \(bu 4
765 Added a section on "Scoping Rules of Regex Variables", and other wording
766 improvements made throughout.
767 .IP \(bu 4
768 Added information on the new \f(CW\*(C`%{^HOOK}\*(C'\fR interface, and the new
769 \&\f(CW\*(C`require_\|_before\*(C'\fR and \f(CW\*(C`require_\|_after\*(C'\fR hooks which it exposes.
770 .IP \(bu 4
771 Correct information on the regex variables \f(CW\*(C`${^PREMATCH}\*(C'\fR, \f(CW\*(C`${^MATCH}\*(C'\fR
772 and \f(CW\*(C`${^POSTMATCH}\*(C'\fR, all of which were incorrectly documented due to an
773 oversight. Specifically they only work properly after a regex operation
774 that used the /p modifier to enable them.
775 .IP \(bu 4
776 Added information on the new regex variable \f(CW\*(C`${^LAST_SUCCESSFUL_PATTERN}\*(C'\fR,
777 which represents the pattern of the last successful regex match in scope.
778 .SH Diagnostics
779 .IX Header "Diagnostics"
780 The following additions or changes have been made to diagnostic output,
781 including warnings and fatal error messages. For the complete list of
782 diagnostic messages, see perldiag.
783 .SS "New Diagnostics"
784 .IX Subsection "New Diagnostics"
785 \fINew Errors\fR
786 .IX Subsection "New Errors"
787 .IP \(bu 4
788 A new syntax error has been added for the error that a \f(CW\*(C`catch\*(C'\fR block does
789 not have its required variable declaration. See
790 catch block requires a (VAR)
791 .IP \(bu 4
792 Too many nested BEGIN blocks, maximum of \f(CW%d\fR allowed
793 .IP \(bu 4
794 Execution of \f(CW%s\fR aborted due to compilation errors.
795 .IP \(bu 4
796 Can't locate object method "INC", nor "INCDIR" nor string overload via
797 package "%s" \f(CW%s\fR in \f(CW@INC\fR
798 .IP \(bu 4
799 Attempt to bless into a class
800 .Sp
801 (F) You are attempting to call \f(CW\*(C`bless\*(C'\fR with a package name that is a
802 new-style \f(CW\*(C`class\*(C'\fR. This is not necessary, as instances created by the
803 constructor are already in the correct class. Instances cannot be created
804 by other means, such as \f(CW\*(C`bless\*(C'\fR.
805 .IP \(bu 4
806 Cannot assign :param(%s) to field \f(CW%s\fR because that name is already in use
807 .Sp
808 (F) An attempt was made to apply a parameter name to a field, when the name
809 is already being used by another field in the same class, or one of its
810 parent classes. This would cause a name clash so is not allowed.
811 .IP \(bu 4
812 Cannot create class \f(CW%s\fR as it already has a non-empty \f(CW@ISA\fR
813 .Sp
814 (F) An attempt was made to create a class out of a package that already has
815 an \f(CW@ISA\fR array, and the array is not empty. This is not permitted, as it
816 would lead to a class with inconsistent inheritance.
817 .IP \(bu 4
818 Cannot invoke a method of "%s" on an instance of "%s"
819 .Sp
820 (F) You tried to directly call a \f(CW\*(C`method\*(C'\fR subroutine of one class by passing
821 in a value that is an instance of a different class. This is not permitted,
822 as the method would not have access to the correct instance fields.
823 .IP \(bu 4
824 Cannot invoke method on a non-instance
825 .Sp
826 (F) You tried to directly call a \f(CW\*(C`method\*(C'\fR subroutine of a class by passing
827 in a value that is not an instance of that class. This is not permitted, as
828 the method would not then have access to its instance fields.
829 .IP \(bu 4
830 Cannot '%s' outside of a 'class'
831 .Sp
832 (F) You attempted to use one of the keywords that only makes sense inside
833 a \f(CW\*(C`class\*(C'\fR definition, at a location that is not inside such a class.
834 .IP \(bu 4
835 Cannot reopen existing class "%s"
836 .Sp
837 (F) You tried to begin a \f(CW\*(C`class\*(C'\fR definition for a class that already exists.
838 A class may only have one definition block.
839 .IP \(bu 4
840 Can't bless an object reference
841 .Sp
842 (F) You attempted to call \f(CW\*(C`bless\*(C'\fR on a value that already refers to a real
843 object instance.
844 .IP \(bu 4
845 can't convert empty path
846 .Sp
847 (F) On Cygwin, you called a path conversion function with an empty path.
848 Only non-empty paths are legal.
849 .IP \(bu 4
850 Class already has a superclass, cannot add another
851 .Sp
852 (F) You attempted to specify a second superclass for a \f(CW\*(C`class\*(C'\fR by using
853 the \f(CW\*(C`:isa\*(C'\fR attribute, when one is already specified. Unlike classes
854 whose instances are created with \f(CW\*(C`bless\*(C'\fR, classes created via the
855 \&\f(CW\*(C`class\*(C'\fR keyword cannot have more than one superclass.
856 .IP \(bu 4
857 Class attribute \f(CW%s\fR requires a value
858 .Sp
859 (F) You specified an attribute for a class that would require a value to
860 be passed in parentheses, but did not provide one. Remember that
861 whitespace is \fBnot\fR permitted between the attribute name and its value;
862 you must write this as
863 .Sp
864 .Vb 1
865 \& class Example::Class :attr(VALUE) ...
866 .Ve
867 .IP \(bu 4
868 Class :isa attribute requires a class but "%s" is not one
869 .Sp
870 (F) When creating a subclass using the \f(CW\*(C`class\*(C'\fR \f(CW\*(C`:isa\*(C'\fR attribute, the
871 named superclass must also be a real class created using the \f(CW\*(C`class\*(C'\fR
872 keyword.
873 .IP \(bu 4
874 Field already has a parameter name, cannot add another
875 .Sp
876 (F) A field may have at most one application of the \f(CW\*(C`:param\*(C'\fR attribute to
877 assign a parameter name to it; once applied a second one is not allowed.
878 .IP \(bu 4
879 Field attribute \f(CW%s\fR requires a value
880 .Sp
881 (F) You specified an attribute for a field that would require a value to
882 be passed in parentheses, but did not provide one. Remember that
883 whitespace is \fBnot\fR permitted between the attribute name and its value;
884 you must write this as
885 .Sp
886 .Vb 1
887 \& field $var :attr(VALUE) ...
888 .Ve
889 .IP \(bu 4
890 Field \f(CW%s\fR is not accessible outside a method
891 .Sp
892 (F) An attempt was made to access a field variable of a class from code
893 that does not appear inside the body of a \f(CW\*(C`method\*(C'\fR subroutine. This is not
894 permitted, as only methods will have access to the fields of an instance.
895 .IP \(bu 4
896 Field \f(CW%s\fR of "%s" is not accessible in a method of "%s"
897 .Sp
898 (F) An attempt was made to access a field variable of a class, from a
899 method of another class nested inside the one that actually defined it.
900 This is not permitted, as only methods defined by a given class are
901 permitted to access fields of that class.
902 .IP \(bu 4
903 Only scalar fields can take a :param attribute
904 .Sp
905 (F) You tried to apply the \f(CW\*(C`:param\*(C'\fR attribute to an array or hash field.
906 Currently this is not permitted.
907 .IP \(bu 4
908 Required parameter '%s' is missing for \f(CW%s\fR constructor
909 .Sp
910 (F) You called the constructor for a class that has a required named
911 parameter, but did not pass that parameter at all.
912 .IP \(bu 4
913 Unexpected characters while parsing class :isa attribute: \f(CW%s\fR
914 .Sp
915 (F) You tried to specify something other than a single class name with an
916 optional trailing version number as the value for a \f(CW\*(C`class\*(C'\fR \f(CW\*(C`:isa\*(C'\fR
917 attribute. This confused the parser.
918 .IP \(bu 4
919 Unrecognized class attribute \f(CW%s\fR
920 .Sp
921 (F) You attempted to add a named attribute to a \f(CW\*(C`class\*(C'\fR definition, but
922 perl does not recognise the name of the requested attribute.
923 .IP \(bu 4
924 Unrecognized field attribute \f(CW%s\fR
925 .Sp
926 (F) You attempted to add a named attribute to a \f(CW\*(C`field\*(C'\fR definition, but
927 perl does not recognise the name of the requested attribute.
928 .IP \(bu 4
929 ${^HOOK}{%s} may only be a CODE reference or undef
930 .IP \(bu 4
931 Attempt to set unknown hook '%s' in %{^HOOK}
932 .IP \(bu 4
933 Missing or undefined argument to \f(CW%s\fR via %{^HOOK}{require_\|_before}
934 .IP \(bu 4
935 Too many capture groups (limit is \f(CW%d\fR) in regex m/%s/
936 .PP
937 \fINew Warnings\fR
938 .IX Subsection "New Warnings"
939 .IP \(bu 4
940 Unknown locale category \f(CW%d\fR
941 .Sp
942 This is a shortened form of an already existing diagnostic, for use when
943 there is no new locale being switched to. The previous diagnostic was
944 misleading in such circumstances.
945 .IP \(bu 4
946 Locale '%s' is unsupported, and may crash the interpreter.
947 .IP \(bu 4
948 Treating \f(CW%s::INIT\fR block as BEGIN block as workaround
949 .IP \(bu 4
950 Filehandle STD%s reopened as \f(CW%s\fR only for input
951 .IP \(bu 4
952 \&\f(CW%s\fR on BEGIN block ignored
953 .IP \(bu 4
954 ADJUST is experimental
955 .Sp
956 (S experimental::class) This warning is emitted if you use the \f(CW\*(C`ADJUST\*(C'\fR
957 keyword of \f(CW\*(C`use feature \*(Aqclass\*(Aq\*(C'\fR. This keyword is currently
958 experimental and its behaviour may change in future releases of Perl.
959 .IP \(bu 4
960 class is experimental
961 .Sp
962 (S experimental::class) This warning is emitted if you use the \f(CW\*(C`class\*(C'\fR
963 keyword of \f(CW\*(C`use feature \*(Aqclass\*(Aq\*(C'\fR. This keyword is currently
964 experimental and its behaviour may change in future releases of Perl.
965 .IP \(bu 4
966 Method \f(CW%s\fR redefined
967 .Sp
968 (W redefine) You redefined a method. To suppress this warning, say
969 .Sp
970 .Vb 4
971 \& {
972 \& no warnings \*(Aqredefine\*(Aq;
973 \& *name = method { ... };
974 \& }
975 .Ve
976 .IP \(bu 4
977 Odd number of elements in hash field initialization
978 .Sp
979 (W misc) You specified an odd number of elements to initialise a hash
980 field of an object. Hashes are initialised from a list of key/value
981 pairs so there must be a corresponding value to every key. The final
982 missing value will be filled in with undef instead.
983 .IP \(bu 4
984 Old package separator "'" deprecated
985 .Sp
986 (W deprecated, syntax) You used the old package separator "'" in a
987 variable, subroutine or package name. Support for the old package
988 separator will be removed in Perl 5.40.
989 .IP \(bu 4
990 field is experimental
991 .Sp
992 (S experimental::class) This warning is emitted if you use the \f(CW\*(C`field\*(C'\fR
993 keyword of \f(CW\*(C`use feature \*(Aqclass\*(Aq\*(C'\fR. This keyword is currently
994 experimental and its behaviour may change in future releases of Perl.
995 .IP \(bu 4
996 method is experimental
997 .Sp
998 (S experimental::class) This warning is emitted if you use the \f(CW\*(C`method\*(C'\fR
999 keyword of \f(CW\*(C`use feature \*(Aqclass\*(Aq\*(C'\fR. This keyword is currently
1000 experimental and its behaviour may change in future releases of Perl.
1001 .IP \(bu 4
1002 Can't call destructor for 0x%p in global destruction
1003 .SS "Changes to Existing Diagnostics"
1004 .IX Subsection "Changes to Existing Diagnostics"
1005 .IP \(bu 4
1006 The compiler will now stop parsing on the first syntax error it
1007 encounters. Historically the compiler would attempt to "skip past" the
1008 error and continue parsing so that it could list multiple errors. For
1009 things like undeclared variables under strict this makes sense. For
1010 syntax errors however it has been found that continuing tends to result
1011 in a storm of unrelated or bizarre errors that mostly just obscure the
1012 true error. In extreme cases it can even lead to segfaults and other
1013 incorrect behavior.
1014 .Sp
1015 Therefore we have reformed the continuation logic so that the parse will
1016 stop after the first seen syntax error. Semantic errors like undeclared
1017 variables will not stop the parse, so you may still see multiple errors
1018 when compiling code. However if there is a syntax error it will be the
1019 last error message reported by perl and all of the errors that you see
1020 will be something that actually needs to be fixed.
1021 .IP \(bu 4
1022 Error messages that output class or package names have been modified to
1023 output double quoted strings with various characters escaped so as to
1024 make the exact value clear to a reader. The exact rules on which
1025 characters are escaped may change over time but currently are that
1026 printable ASCII codepoints, with the exception of \f(CW\*(C`"\*(C'\fR and \f(CW\*(C`\e\*(C'\fR, and
1027 unicode word characters whose codepoint is over 255 are output raw, and
1028 any other symbols are escaped much as Data::Dumper might escape them,
1029 using \f(CW\*(C`\en\*(C'\fR for newline and \f(CW\*(C`\e"\*(C'\fR for double quotes, etc. Codepoints in
1030 the range 128\-255 are always escaped as they can cause trouble on
1031 unicode terminals when output raw.
1032 .Sp
1033 In older versions of perl the one liner
1034 .Sp
1035 .Vb 1
1036 \& $ perl \-le\*(Aq"thing\en"\->foo()\*(Aq
1037 .Ve
1038 .Sp
1039 would output the following error message exactly as shown here, with
1040 text spread over multiple lines because the "\en" would be emitted as
1041 a raw newline character:
1042 .Sp
1043 .Vb 3
1044 \& Can\*(Aqt locate object method "foo" via package "thing
1045 \& " (perhaps you forgot to load "thing
1046 \& "?) at \-e line 1.
1047 .Ve
1048 .Sp
1049 As of this release we would output this instead (as one line):
1050 .Sp
1051 .Vb 2
1052 \& Can\*(Aqt locate object method "foo" via package "thing\en"
1053 \& (perhaps you forgot to load "thing\en"?) at \-e line 1.
1054 .Ve
1055 .Sp
1056 Notice the newline in the package name has been quoted and escaped, and
1057 thus the error message is a single line. The text is shown here wrapped
1058 to two lines only for readability.
1059 .IP \(bu 4
1060 When package or class names in errors are very large the middle excess
1061 portion will be elided from the message. As of this release error messages
1062 will show only up to the first 128 characters and the last 128 characters
1063 in a package or class name in error messages. For example
1064 .Sp
1065 .Vb 1
1066 \& $ perl \-le\*(Aq("Foo" x 1000)\->new()\*(Aq
1067 .Ve
1068 .Sp
1069 will output the following as one line:
1070 .Sp
1071 .Vb 10
1072 \& Can\*(Aqt locate object method "new" via package "FooFooFooFooFooFooFoo
1073 \& FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo
1074 \& FooFooFooFooFooFooFooFooFooFooFooFooFooFo"..."oFooFooFooFooFooFooFoo
1075 \& FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo
1076 \& FooFooFooFooFooFooFooFooFooFooFooFooFoo" (perhaps you forgot to load
1077 \& "FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo
1078 \& FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFo"...
1079 \& "oFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo
1080 \& FooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo"?)
1081 \& at \-e line 1.
1082 .Ve
1083 .Sp
1084 Notice the \f(CW "prefix"..."suffix" \fR form of the package name in this case.
1085 In previous versions of perl the complete string would have been shown
1086 making the error message over 6k long and there was no upper limit on the
1087 length of the error message at all. If you accidentally used a 1MB string
1088 as a class name then the error message would be over 2MB long. In this perl
1089 the upper limit should be around 2k when eliding and escaping are taken into
1090 account.
1091 .IP \(bu 4
1092 Removed \f(CW\*(C`Complex regular subexpression recursion limit (%d) exceeded\*(C'\fR
1093 .Sp
1094 The regular expresion engine has not used recursion in some time. This
1095 warning no longer makes sense.
1096 .Sp
1097 See [GH #19636 <https://github.com/Perl/perl5/pull/19636>].
1098 .IP \(bu 4
1099 Various warnings that used to produce parenthesized hints underneath the
1100 main warning message and after its "location data" were chanaged to put
1101 the hint inline with the main message. For instance:
1102 .Sp
1103 .Vb 2
1104 \& Bareword found where operator expected at \-e line 1, near "foo bar"
1105 \& (Do you need to predeclare foo?)
1106 .Ve
1107 .Sp
1108 will now look like this but as one line:
1109 .Sp
1110 .Vb 2
1111 \& Bareword found where operator expected (Do you need to predeclare
1112 \& foo?) at \-e line 1, near "foo bar"
1113 .Ve
1114 .Sp
1115 as a result such warnings will no longer trigger \f(CW$SIG{_\|_WARN_\|_}\fR
1116 twice, and the hint will be visible when fatal warnings is in effect.
1117 .IP \(bu 4
1118 The error message that is produced when a \f(CW\*(C`require\*(C'\fR or \f(CW\*(C`use\*(C'\fR statement
1119 fails has been changed. It used to contain the words \f(CW\*(C`@INC contains:\*(C'\fR,
1120 and it used to show the state of \f(CW@INC\fR *after* the require had
1121 completed and failed. The error message has been changed to say \f(CW\*(C`@INC
1122 entries checked:\*(C'\fR and to reflect the actual directories or hooks that
1123 were executed during the require statement. For example:
1124 .Sp
1125 .Vb 4
1126 \& perl \-e\*(Aqpush @INC, sub {@INC=()}; eval "require Frobnitz"
1127 \& or die $@\*(Aq
1128 \& Can\*(Aqt locate Frobnitz.pm in @INC (you may need to install the
1129 \& Frobnitz module) (@INC contains:) at (eval 1) line 1.
1130 .Ve
1131 .Sp
1132 Will change to (with some output elided for clarity):
1133 .Sp
1134 .Vb 7
1135 \& perl \-e\*(Aqpush @INC, sub {@INC=()}; eval "require Frobnitz"
1136 \& or die $@\*(Aq
1137 \& Can\*(Aqt locate Frobnitz.pm in @INC (you may need to install the
1138 \& Frobnitz module) (@INC entries checked:
1139 \& .../site_perl/5.38.0/x86_64\-linux .../site_perl/5.38.0
1140 \& .../5.38.0/x86_64\-linux .../5.38.0 CODE(0x562745e684b8))
1141 \& at (eval 1) line 1.
1142 .Ve
1143 .Sp
1144 thus showing the actual directories checked. Code that checks for
1145 \&\f(CW\*(C`@INC contains:\*(C'\fR in error messages should be hardened against any future
1146 wording changes between the \f(CW@INC\fR and \f(CW\*(C`:\*(C'\fR, for instance use
1147 \&\f(CW\*(C`qr/\e@INC[ \ew]+:/\*(C'\fR instead of using \f(CW\*(C`qr/\e@INC contains:/\*(C'\fR or
1148 \&\f(CW\*(C`qr/\e@INC entries checked:/\*(C'\fR in tests as this will ensure both forward
1149 and backward compatibility.
1150 .IP \(bu 4
1151 Old package separator used in string
1152 .Sp
1153 This diagnostic is now also part of the \f(CW\*(C`deprecated\*(C'\fR category.
1154 .IP \(bu 4
1155 given is deprecated replaces \f(CW\*(C`given is experimental\*(C'\fR.
1156 .IP \(bu 4
1157 when is deprecated replaces \f(CW\*(C`when is experimental\*(C'\fR.
1158 .IP \(bu 4
1159 Smartmatch is deprecated replaces \f(CW\*(C`Smartmatch is experimental\*(C'\fR.
1160 .SH "Configuration and Compilation"
1161 .IX Header "Configuration and Compilation"
1162 .IP \(bu 4
1163 \&\f(CW\*(C`make \-j6 minitest\*(C'\fR could fail due to a build conflict in building
1164 \&\f(CW\*(C`$(MINIPERL_EXE)\*(C'\fR between the main make process and a child process.
1165 [GH #19829 <https://github.com/Perl/perl5/issues/19829>]
1166 .IP \(bu 4
1167 Properly populate osvers on Dragonfly BSD when the hostname isn't set.
1168 .IP \(bu 4
1169 Fix typos for C99 macro name \f(CW\*(C`PRIX64\*(C'\fR.
1170 .IP \(bu 4
1171 Remove ancient and broken GCC for VMS support
1172 .IP \(bu 4
1173 Remove vestigial reference to \f(CW\*(C`/VAXC\*(C'\fR qualifier
1174 .IP \(bu 4
1175 Remove sharedperl option on VMS
1176 .IP \(bu 4
1177 VMS now has mkostemp
1178 .IP \(bu 4
1179 \&\f(CW\*(C`Configure\*(C'\fR now properly handles quoted elements outputted by gcc.
1180 [GH #20606 <https://github.com/Perl/perl5/issues/20606>]
1181 .IP \(bu 4
1182 \&\f(CW\*(C`Configure\*(C'\fR probed for the return type of \fBmalloc()\fR and \fBfree()\fR by
1183 testing whether declarations for those functions produced a function
1184 type mismatch with the implementation. On Solaris, with a C++
1185 compiler, this check always failed, since Solaris instead imports
1186 \&\fBmalloc()\fR and \fBfree()\fR from \f(CW\*(C`std::\*(C'\fR with \f(CW\*(C`using\*(C'\fR for C++ builds. Since
1187 the return types of \fBmalloc()\fR and \fBfree()\fR are well defined by the C
1188 standard, skip probing for them. \f(CW\*(C`Configure\*(C'\fR command-line arguments
1189 and hints can still override these type in the unlikely case that is
1190 needed. [GH #20806 <https://github.com/Perl/perl5/issues/20806>]
1191 .SH Testing
1192 .IX Header "Testing"
1193 Tests were added and changed to reflect the other additions and
1194 changes in this release. Furthermore, these significant changes were
1195 made:
1196 .IP \(bu 4
1197 Unicode normalization tests have been added.
1198 .IP \(bu 4
1199 t/test.pl: Add ability to cancel an watchdog timer
1200 .SH "Platform Support"
1201 .IX Header "Platform Support"
1202 .SS "Discontinued Platforms"
1203 .IX Subsection "Discontinued Platforms"
1204 .IP Ultrix 4
1205 .IX Item "Ultrix"
1206 Support code for DEC Ultrix has been removed. Ultrix was the native
1207 Unix-like operating system for various Digital Equipment Corporation
1208 machines. Its final release was in 1995.
1209 .SS "Platform-Specific Notes"
1210 .IX Subsection "Platform-Specific Notes"
1211 .IP DragonflyBSD 4
1212 .IX Item "DragonflyBSD"
1213 Skip tests to workaround an apparent bug in \f(CWsetproctitle()\fR.
1214 [GH #19894 <https://github.com/Perl/perl5/issues/19894>]
1215 .IP FreeBSD 4
1216 .IX Item "FreeBSD"
1217 FreeBSD no longer uses thread-safe locale operations, to avoid a bug in
1218 FreeBSD <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265950>
1219 .Sp
1220 Replace the first part of archname with \f(CW\*(C`uname \-p\*(C'\fR
1221 [GH #19791 <https://github.com/Perl/perl5/issues/19791>]
1222 .IP Solaris 4
1223 .IX Item "Solaris"
1224 Avoid some compiler and compilation issues on NetBSD/Solaris from regexec.c and regcomp.c.
1225 .IP Synology 4
1226 .IX Item "Synology"
1227 Update Synology Readme for DSM 7.
1228 .IP Windows 4
1229 .IX Item "Windows"
1230 Fix win32 memory alignment needed for gcc\-12 from vmem.h.
1231 .Sp
1232 \&\fButimes()\fR on Win32 would print a message to stderr if it failed to
1233 convert a supplied \f(CW\*(C`time_t\*(C'\fR to a \f(CW\*(C`FILETIME\*(C'\fR.
1234 [GH #19668 <https://github.com/Perl/perl5/issues/19668>]
1235 .Sp
1236 In some cases, timestamps returned by \fBstat()\fR and
1237 \&\fBlstat()\fR failed to take daylight saving time into account.
1238 [GH #20018 <https://github.com/Perl/perl5/issues/20018>]
1239 [GH #20061 <https://github.com/Perl/perl5/issues/20061>]
1240 .Sp
1241 \&\fBstat()\fR now works on \f(CW\*(C`AF_UNIX\*(C'\fR socket files.
1242 [GH #20204 <https://github.com/Perl/perl5/issues/20204>]
1243 .Sp
1244 \&\fBreadlink()\fR now returns the \f(CW\*(C`PrintName\*(C'\fR from a symbolic link reparse
1245 point instead of the \f(CW\*(C`SubstituteName\*(C'\fR, which should make it better
1246 match the name the link was created with.
1247 [GH #20271 <https://github.com/Perl/perl5/pull/20271>]
1248 .Sp
1249 \&\fBlstat()\fR on Windows now returns the length of the link target as the
1250 size of the file, as it does on POSIX systems.
1251 [GH #20476 <https://github.com/Perl/perl5/issues/20476>]
1252 .Sp
1253 \&\fBsymlink()\fR on Windows now replaces any \f(CW\*(C`/\*(C'\fR in the target with \f(CW\*(C`\e\*(C'\fR,
1254 since Windows does not recognise \f(CW\*(C`/\*(C'\fR in symbolic links. The reverse
1255 translation is \fBnot\fR done by \fBreadlink()\fR.
1256 [GH #20506 <https://github.com/Perl/perl5/issues/20506>]
1257 .Sp
1258 \&\fBsymlink()\fR where the target was an absolute path to a directory was
1259 incorrectly created as a file symbolic link.
1260 [GH #20533 <https://github.com/Perl/perl5/issues/20533>]
1261 .Sp
1262 \&\f(CW\*(C`POSIX::dup2\*(C'\fR no longer creates broken sockets. [GH
1263 #20920 <https://github.com/Perl/perl5/issues/20920>]
1264 .Sp
1265 Closing a busy pipe could cause Perl to hang. [GH
1266 #19963 <https://github.com/Perl/perl5/issues/19963>]
1267 .SH "Internal Changes"
1268 .IX Header "Internal Changes"
1269 .IP \(bu 4
1270 Removed many deprecated C functions.
1271 .Sp
1272 These have been deprecated for a long time. See
1273 <https://github.com/perl/perl5/commit/7008caa915ad99e650acf2aea40612b5e48b7ba2>
1274 for a full list.
1275 .IP \(bu 4
1276 \&\f(CW\*(C`get_op_descs\*(C'\fR, \f(CW\*(C`get_op_names\*(C'\fR, \f(CW\*(C`get_opargs\*(C'\fR, \f(CW\*(C`get_no_modify\*(C'\fR and
1277 \&\f(CW\*(C`get_ppaddr\*(C'\fR have been marked deprecated.
1278 .IP \(bu 4
1279 \&\f(CW\*(C`hv_free_ent\*(C'\fR has been marked as internal API.
1280 .IP \(bu 4
1281 \&\f(CW\*(C`save_pushptr\*(C'\fR, \f(CW\*(C`save_pushptrptr\*(C'\fR, and \f(CW\*(C`save_pushi32ptr\*(C'\fR have been marked
1282 as internal API.
1283 .IP \(bu 4
1284 New bool related functions and macros have been added to complement the new
1285 bool type introduced in 5.36:
1286 .Sp
1287 The functions are:
1288 .RS 4
1289 .ie n .IP """newSVbool(const bool bool_val)""" 4
1290 .el .IP "\f(CWnewSVbool(const bool bool_val)\fR" 4
1291 .IX Item "newSVbool(const bool bool_val)"
1292 .PD 0
1293 .ie n .IP newSV_true() 4
1294 .el .IP \f(CWnewSV_true()\fR 4
1295 .IX Item "newSV_true()"
1296 .ie n .IP newSV_false() 4
1297 .el .IP \f(CWnewSV_false()\fR 4
1298 .IX Item "newSV_false()"
1299 .ie n .IP """sv_set_true(SV *sv)""" 4
1300 .el .IP "\f(CWsv_set_true(SV *sv)\fR" 4
1301 .IX Item "sv_set_true(SV *sv)"
1302 .ie n .IP """sv_set_false(SV *sv)""" 4
1303 .el .IP "\f(CWsv_set_false(SV *sv)\fR" 4
1304 .IX Item "sv_set_false(SV *sv)"
1305 .ie n .IP """sv_set_bool(SV *sv, const bool bool_val)""" 4
1306 .el .IP "\f(CWsv_set_bool(SV *sv, const bool bool_val)\fR" 4
1307 .IX Item "sv_set_bool(SV *sv, const bool bool_val)"
1308 .RE
1309 .RS 4
1310 .PD
1311 .Sp
1312 The macros are:
1313 .ie n .IP SvIandPOK(sv) 4
1314 .el .IP \f(CWSvIandPOK(sv)\fR 4
1315 .IX Item "SvIandPOK(sv)"
1316 .PD 0
1317 .ie n .IP SvIandPOK_off(sv) 4
1318 .el .IP \f(CWSvIandPOK_off(sv)\fR 4
1319 .IX Item "SvIandPOK_off(sv)"
1320 .ie n .IP """SvIandPOK_on""" 4
1321 .el .IP \f(CWSvIandPOK_on\fR 4
1322 .IX Item "SvIandPOK_on"
1323 .RE
1324 .RS 4
1325 .RE
1326 .IP \(bu 4
1327 .PD
1328 Perl is no longer manipulating the \f(CW\*(C`environ\*(C'\fR array directly. The variable
1329 \&\f(CW\*(C`PL_use_safe_putenv\*(C'\fR has been removed and \f(CW\*(C`PERL_USE_SAFE_PUTENV\*(C'\fR is always
1330 defined. This means XS modules can now call \f(CW\*(C`setenv\*(C'\fR and \f(CW\*(C`putenv\*(C'\fR without
1331 causing segfaults. [perl #19399 <https://github.com/Perl/perl5/issues/19399>]
1332 .IP \(bu 4
1333 Internal C API functions are now hidden with \f(CW\*(C`_\|_attribute_\|_((hidden))\*(C'\fR on the
1334 platforms that support it. This means they are no longer callable from XS
1335 modules on those platforms.
1336 .Sp
1337 It should be noted that those functions have always been hidden on Windows. This
1338 change merely brings that to the other platforms.
1339 [perl #19655 <https://github.com/Perl/perl5/pull/19655>]
1340 .IP \(bu 4
1341 New formatting symbols were added for printing values declared as \f(CW\*(C`U32\*(C'\fR or
1342 \&\f(CW\*(C`I32\*(C'\fR:
1343 .RS 4
1344 .ie n .IP "I32df \-\- Like %d" 4
1345 .el .IP "I32df \-\- Like \f(CW%d\fR" 4
1346 .IX Item "I32df -- Like %d"
1347 .PD 0
1348 .ie n .IP "U32of \-\- Like %o" 4
1349 .el .IP "U32of \-\- Like \f(CW%o\fR" 4
1350 .IX Item "U32of -- Like %o"
1351 .ie n .IP "U32uf \-\- Like %u" 4
1352 .el .IP "U32uf \-\- Like \f(CW%u\fR" 4
1353 .IX Item "U32uf -- Like %u"
1354 .ie n .IP "U32xf \-\- Like %x" 4
1355 .el .IP "U32xf \-\- Like \f(CW%x\fR" 4
1356 .IX Item "U32xf -- Like %x"
1357 .ie n .IP "U32Xf \-\- Like %X" 4
1358 .el .IP "U32Xf \-\- Like \f(CW%X\fR" 4
1359 .IX Item "U32Xf -- Like %X"
1360 .RE
1361 .RS 4
1362 .PD
1363 .Sp
1364 These are used in the same way already existing similar symbols, such as
1365 \&\f(CW\*(C`IVdf\*(C'\fR, are used. See "I/O Formats" in perlapi.
1366 .RE
1367 .IP \(bu 4
1368 new 'HvHasAUX' macro
1369 .IP \(bu 4
1370 regexec.c: Add some branch predictions reorder conds
1371 .IP \(bu 4
1372 locale: Change macro name to be C conformant
1373 .IP \(bu 4
1374 Rename the \f(CW\*(C`PADNAMEt_*\*(C'\fR constants to \f(CW\*(C`PADNAMEf_*\*(C'\fR
1375 .IP \(bu 4
1376 Changes all the API macros that retrieve a PV into a call to an
1377 inline function so as to evaluate the parameter just once.
1378 .IP \(bu 4
1379 regexec.c: multiple code refactor to make the code more readable
1380 .IP \(bu 4
1381 perl.h: Change macro name to be C conformant
1382 (remove leading _ from NOT_IN_NUMERIC macros)
1383 .IP \(bu 4
1384 regcomp.h: add new \f(CW\*(C`BITMAP_BIT\*(C'\fR macro in addition to the existing \f(CW\*(C`BITMAP_BYTE\*(C'\fR
1385 and \f(CW\*(C`BITMAP_TEST\*(C'\fR ones.
1386 .IP \(bu 4
1387 Create new regnode type ANYOFH.
1388 populate_ANYOF_from_invlist was renamed to populate_bitmap_from_invlist
1389 .IP \(bu 4
1390 regex: Refactor bitmap vs non-bitmap of qr/[]/
1391 .IP \(bu 4
1392 regcomp.c: add new functions to convert from an inversion list to a bitmap (and vice versa)
1393 \&\f(CW\*(C`populate_bitmap_from_invlist\*(C'\fR and \f(CW\*(C`populate_invlist_from_bitmap\*(C'\fR.
1394 .IP \(bu 4
1395 Add \f(CWnewAVav()\fR to create an AV from an existing AV.
1396 Add \f(CWnewAVhv()\fR to create an AV using keys and values from an existing HV.
1397 .IP \(bu 4
1398 Fix definition of \f(CW\*(C`Perl_atof\*(C'\fR.
1399 .IP \(bu 4
1400 Fix undefined behavior with overflow related \f(CW\*(C`OPTIMIZE_INFTY\*(C'\fR and delta
1401 in \fIregcomp.c\fR.
1402 .IP \(bu 4
1403 Fix regnode pointer alignment issue in \fIregcomp.h\fR.
1404 .IP \(bu 4
1405 The \f(CW\*(C`CVf_METHOD\*(C'\fR CV flag and associated \f(CW\*(C`CvMETHOD\*(C'\fR macro has been renamed to
1406 \&\f(CW\*(C`CVf_NOWARN_AMBIGUOUS\*(C'\fR and \f(CW\*(C`CvNOWARN_AMBIGUOUS\*(C'\fR. This closer reflects its
1407 actual behaviour (it suppresses a warning that would otherwise be generated
1408 about ambiguous names), in order to be less confusing with \f(CW\*(C`CvIsMETHOD\*(C'\fR,
1409 which indicates that a CV is a \f(CW\*(C`method\*(C'\fR subroutine relating to the \f(CW\*(C`class\*(C'\fR
1410 feature.
1411 .IP \(bu 4
1412 The \f(CW\*(C`OPf_SPECIAL\*(C'\fR flag is no longer set on the \f(CW\*(C`OP_ENTERSUB\*(C'\fR op
1413 constructed to call the \f(CW\*(C`VERSION\*(C'\fR, \f(CW\*(C`import\*(C'\fR and \f(CW\*(C`unimport\*(C'\fR methods
1414 as part of a \f(CW\*(C`use\*(C'\fR statement and attribute application, nor when
1415 assigning to an \f(CW\*(C`:lvalue\*(C'\fR subroutine.
1416 .IP \(bu 4
1417 A new CV flag \f(CW\*(C`CVf_REFCOUNTED_ANYSV\*(C'\fR has been added, which indicates that the
1418 CV is an XSUB and stores an SV pointer in the \f(CW\*(C`CvXSUBANY.any_sv\*(C'\fR union field.
1419 Perl core operations such as cloning or destroying the CV will maintain the
1420 reference count of the pointed-to SV, destroying it when required.
1421 .IP \(bu 4
1422 A new API function "\f(CW\*(C`Perl_localeconv\*(C'\fR" in perlapi is added. This is the
1423 same as \f(CW\*(C`POSIX::localeconv\*(C'\fR (returning a hash of
1424 the \f(CWlocaleconv()\fR fields), but directly callable from XS code.
1425 .IP \(bu 4
1426 A new API function, "\f(CW\*(C`Perl_langinfo8\*(C'\fR" in perlapi is added. This is the
1427 same as plain "\f(CW\*(C`Perl_langinfo\*(C'\fR" in perlapi, but with an extra parameter
1428 that allows the caller to simply and reliably know if the returned
1429 string is UTF\-8.
1430 .IP \(bu 4
1431 We have introduced a limit on the number of nested \f(CW\*(C`eval EXPR\*(C'\fR/\f(CW\*(C`BEGIN\*(C'\fR
1432 blocks and \f(CW\*(C`require\*(C'\fR/\f(CW\*(C`BEGIN\*(C'\fR (and thus \f(CW\*(C`use\*(C'\fR statements as well) to
1433 prevent C stack overflows. This variable can also be used to forbid
1434 \&\f(CW\*(C`BEGIN\*(C'\fR blocks from executing during \f(CW\*(C`eval EXPR\*(C'\fR compilation. The
1435 limit defaults to \f(CW1000\fR but can be overridden by setting the
1436 \&\f(CW\*(C`${^MAX_NESTED_EVAL_BEGIN_BLOCKS}\*(C'\fR variable. The default itself can be
1437 changed at compile time with
1438 .Sp
1439 .Vb 1
1440 \& \-Accflags=\*(Aq\-DPERL_MAX_NESTED_EVAL_BEGIN_BLOCKS_DEFAULT=12345\*(Aq
1441 .Ve
1442 .Sp
1443 Note that this value relates to the size of your C stack and if you
1444 choose an inappropriately large value Perl may segfault, be conservative
1445 about what you choose.
1446 .IP \(bu 4
1447 A new magic type \f(CW\*(C`PERL_MAGIC_extvalue\*(C'\fR has been added. This is available for
1448 use like \f(CW\*(C`PERL_MAGIC_ext\*(C'\fR, but is a value magic: upon localization the new
1449 value will not be magical.
1450 .IP \(bu 4
1451 The \f(CWSSNEW()\fR, \f(CWSSNEWt()\fR, \f(CWSSNEWa()\fR and \f(CWSSNEWat()\fR APIs now
1452 return a \f(CW\*(C`SSize_t\*(C'\fR value. The \f(CWSSPTR()\fR and \f(CWSSPTRt()\fR macros now
1453 expect a \f(CW\*(C`SSize_t\*(C'\fR parameter, and enforce that on debugging builds.
1454 [GH #20411 <https://github.com/Perl/perl5/issues/20411>]
1455 .IP \(bu 4
1456 Filenames in cops are now refcounted under threads.
1457 Under threads we were copying the filenames into each opcode. This is because in
1458 theory opcodes created in one thread can be destroyed in another.
1459 The change adds a new struct/type \f(CW\*(C`RCPV\*(C'\fR, which is a refcounted
1460 string using shared memory. This is implemented in such a way that code
1461 that previously used a char * can continue to do so, as the refcounting
1462 data is located a specific offset before the char * pointer itself.
1463 .IP \(bu 4
1464 Added \f(CW\*(C`HvNAMEf\*(C'\fR and \f(CW\*(C`HvNAMEf_QUOTEDPREFIX\*(C'\fR special formats. They take an
1465 \&\f(CW\*(C`HV *\*(C'\fR as an argument and use \f(CWHvNAME()\fR and related macros to determine the
1466 string, its length, and whether it is utf8.
1467 .IP \(bu 4
1468 The underlying \f(CW\*(C`Perl_dowantarray\*(C'\fR function implementing the
1469 long-deprecated \f(CW\*(C`GIMME\*(C'\fR macro has been marked as
1470 deprecated, so that use of the macro emits a compile-time warning.
1471 \&\f(CW\*(C`GIMME\*(C'\fR has been documented as deprecated in favour of
1472 \&\f(CW\*(C`GIMME_V\*(C'\fR since Perl v5.6.0, but had not
1473 previously issued a warning.
1474 .IP \(bu 4
1475 The API function "utf8_length" in perlapi is now more efficient.
1476 .IP \(bu 4
1477 Added \f(CWSAVERCPV()\fR and \f(CWSAVEFREERCPV()\fR for better support for working
1478 with \f(CW\*(C`RCPV\*(C'\fR (reference counted string/pointer value) structures which
1479 currently are used in opcodes to share filename and warning bit data in
1480 a memory efficient manner.
1481 .IP \(bu 4
1482 Added \f(CWMORTALSVFUNC_SV()\fR and \f(CWMORTALDESTRUCTOR_SV()\fR macros, which
1483 make it possible to create a destructor which is fired at the end of
1484 the current statement. This uses the \f(CW\*(C`PERL_MAGIC_destruct\*(C'\fR magic to
1485 use "free" magic to trigger an action when a variable is freed. The
1486 action can be specified as a C function or as a Perl code reference.
1487 .IP \(bu 4
1488 Added the \f(CW\*(C`%{^HOOK}\*(C'\fR api and related \f(CW\*(C`PERL_MAGIC_hook\*(C'\fR and
1489 \&\f(CW\*(C`PERL_MAGIC_hookelem\*(C'\fR for providing ways to hook selected perl functions
1490 which for one reason or another are problematic to wrap with a customized
1491 subroutine.
1492 .IP \(bu 4
1493 Added support for \f(CW\*(C`${^HOOK}{require_\|_before}\*(C'\fR which can be used to
1494 rewrite the filename that \f(CW\*(C`require\*(C'\fR will try to load, and also to block
1495 \&\f(CW\*(C`require\*(C'\fR from loading a specific module, even via fully qualified
1496 filename. The hook can also be used to perform "pre-require" and
1497 "post-require" actions.
1498 .IP \(bu 4
1499 Added support for \f(CW\*(C`${^HOOK}{require_\|_after}\*(C'\fR which can be used to
1500 track what modules have been required after the fact.
1501 .IP \(bu 4
1502 Regular expression opcodes (regops) now use a standardized structure
1503 layout that uses unions to expose data in different format. This means
1504 it should be much easier to extend or modify regops to use more memory.
1505 This has been used to make a number of regops track how many parens
1506 they contain.
1507 .SH "Selected Bug Fixes"
1508 .IX Header "Selected Bug Fixes"
1509 .IP \(bu 4
1510 Avoid recursion and stack overflow parsing 'pack' template
1511 .Sp
1512 [GH #16319 <https://github.com/Perl/perl5/issues/16319>]
1513 .IP \(bu 4
1514 An \fBeval()\fR as the last statement in a regex code block could trigger an
1515 interpreter panic; e.g.
1516 .Sp
1517 .Vb 1
1518 \& /(?{ ...; eval {....}; })/
1519 .Ve
1520 .Sp
1521 [GH #19680 <https://github.com/Perl/perl5/issues/19680>]
1522 .IP \(bu 4
1523 Disabling the \f(CW\*(C`bareword_filehandles\*(C'\fR feature no longer treats \f(CW\*(C`print
1524 Class\->method\*(C'\fR as an error. [GH #19704 <https://github.com/Perl/perl5/issues/19704>]
1525 .IP \(bu 4
1526 When a Perl subroutine tail-calls an XS subroutine using \f(CW\*(C`goto &xs_sub\*(C'\fR,
1527 the XS subroutine can now correctly determine its calling context.
1528 Previously it was always reported as scalar.
1529 .Sp
1530 In addition, where the Perl subroutine is freed at the same time:
1531 .Sp
1532 .Vb 1
1533 \& sub foo { *foo = sub {}; goto &xs_sub }
1534 .Ve
1535 .Sp
1536 this formerly could lead to crashes if the XS subroutine tried to use the
1537 value of \f(CW\*(C`PL_op\*(C'\fR, since this was being set to NULL. This is now fixed.
1538 .Sp
1539 [GH #19936 <https://github.com/Perl/perl5/issues/19936>]
1540 .IP \(bu 4
1541 \&\fBsetsockopt()\fR now uses the mechanism added in 5.36 to better
1542 distinguish between numeric and string values supplied as the
1543 \&\f(CW\*(C`OPTVAL\*(C'\fR parameter. [GH #18761 <https://github.com/Perl/perl5/issues/18761>]
1544 .IP \(bu 4
1545 4\-argument \f(CWselect()\fR now rejects strings with code points above
1546 255. Additionally, for code points 128\-255, this operator will now always
1547 give the corresponding octet to the OS, regardless of how Perl stores
1548 such code points in memory. (Previously Perl leaked its internal string
1549 storage to the OS.) [GH #19882 <https://github.com/Perl/perl5/issues/19882>]
1550 .IP \(bu 4
1551 Fix panic issue from \f(CW\*(C`val {} inside /(?{...})/\*(C'\fR [GH #19390 <https://github.com/Perl/perl5/issues/19390>]
1552 .IP \(bu 4
1553 Fix multiple compiler warnings from \fIregexp.c\fR, \fIlocale.c\fR
1554 [GH #19915 <https://github.com/Perl/perl5/issues/19915>]
1555 .IP \(bu 4
1556 Fix a bug with querying locales on platforms that don't have \f(CW\*(C`LC_NUMERIC\*(C'\fR
1557 [GH #19890 <https://github.com/Perl/perl5/issues/19890>]
1558 .IP \(bu 4
1559 Prevent undefined behaviour in \f(CWS_maybe_multideref()\fR.
1560 .IP \(bu 4
1561 Avoid signed integer overflow in \f(CW\*(C`use integer\*(C'\fR ops.
1562 .IP \(bu 4
1563 Avoid adding an offset to a NULL pointer in \f(CW\*(C`hv_delete_common\*(C'\fR.
1564 .IP \(bu 4
1565 PerlIO::get_layers will now accept IO references too
1566 .Sp
1567 Previously it would only take glob references or names of globs. Now it will
1568 also accept IO references.
1569 .IP \(bu 4
1570 Fixes to memory handling for \f(CW\*(C`PL_splitstr\*(C'\fR:
1571 .RS 4
1572 .IP \(bu 4
1573 If a thread was created the allocated string would be freed twice.
1574 .IP \(bu 4
1575 If two \f(CW\*(C`\-F\*(C'\fR switches were supplied the memory allocated for the first
1576 switch wouldn't be freed.
1577 .RE
1578 .RS 4
1579 .RE
1580 .IP \(bu 4
1581 Correctly handle \f(CW\*(C`OP_ANONCODE\*(C'\fR ops generated by CPAN modules that
1582 don't include the OPf_REF flag when propagating lvalue context.
1583 [GH #20532 <https://github.com/Perl/perl5/pull/20532>]
1584 .IP \(bu 4
1585 POSIX::strxfrm now uses the \f(CW\*(C`LC_CTYPE\*(C'\fR locale category
1586 to specify its collation, ignoring any differing \f(CW\*(C`LC_COLLATE\*(C'\fR. It
1587 doesn't make sense for a string to be encoded in one locale (say,
1588 ISO\-8859\-6, Arabic) and to collate it based on another (like ISO\-8859\-7,
1589 Greek). Perl assumes that the current \f(CW\*(C`LC_CTYPE\*(C'\fR locale correctly
1590 represents the encoding, and collates accordingly.
1591 .Sp
1592 Also, embedded \f(CW\*(C`NUL\*(C'\fR characters are now allowed in the input.
1593 .Sp
1594 If locale collation is not enabled on the platform (\f(CW\*(C`LC_COLLATE\*(C'\fR), the
1595 input is returned unchanged.
1596 .IP \(bu 4
1597 Double FETCH during stringification of tied scalars returning an
1598 overloaded object have been fixed. The FETCH method should only be
1599 called once, but prior to this release was actually called twice.
1600 [GH #20574 <https://github.com/Perl/perl5/pull/20574>]
1601 .IP \(bu 4
1602 Writing to a magic variables associated with the selected output
1603 handle, \f(CW$^\fR, \f(CW$~\fR, \f(CW$=\fR, \f(CW\*(C`$\-\*(C'\fR and \f(CW$%\fR, no longer crashes perl
1604 if the IO object has been cleared from the selected output
1605 handle. [GH #20733 <https://github.com/Perl/perl5/issues/20733>]
1606 .IP \(bu 4
1607 Redefining a \f(CW\*(C`use constant\*(C'\fR list constant with \f(CW\*(C`use constant\*(C'\fR now
1608 properly warns. This changes the behaviour of \f(CW\*(C`use constant\*(C'\fR but is
1609 a core change, not a change to \fIconstant.pm\fR. [GH #20742 <https://github.com/Perl/perl5/issues/20742>]
1610 .IP \(bu 4
1611 Redefining a \f(CW\*(C`use constant\*(C'\fR list constant with an empty prototype
1612 constant sub would result in an assertion failure. [GH #20742 <https://github.com/Perl/perl5/issues/20742>]
1613 .IP \(bu 4
1614 Fixed a regression where the \f(CW\*(C`INC\*(C'\fR method for objects in \f(CW@INC\fR
1615 would not be resolved by \f(CW\*(C`AUTOLOAD\*(C'\fR, while it was in 5.36. The
1616 \&\f(CW\*(C`INCDIR\*(C'\fR method for objects in \f(CW@INC\fR cannot be resolved by
1617 \&\f(CW\*(C`AUTOLOAD\*(C'\fR as \f(CW\*(C`INC\*(C'\fR would have been resolved first. [GH #20665 <https://github.com/Perl/perl5/issues/20665>]
1618 .IP \(bu 4
1619 \&\f(CW$SIG{_\|_DIE_\|_}\fR will now be called from eval when the code dies during
1620 compilation regardless of how it dies. This means that code expecting to
1621 be able to upgrade \f(CW$@\fR into an object will be called consistently. In
1622 earlier versions of perl \f(CW$SIG{_\|_DIE_\|_}\fR would not be called for
1623 certain compilation errors, for instance undeclared variables. For other
1624 errors it might be called if there were more than a certain number of
1625 errors, but not if there were less. Now you can expect that it will be
1626 called in every case.
1627 .IP \(bu 4
1628 Compilation of code with errors used to inconsistently stop depending on
1629 the count and type of errors encountered. The intent was that after 10
1630 errors compilation would halt, but bugs in this logic meant that certain
1631 types of error would be counted, but would not trigger the threshold
1632 check to stop compilation. Other errors would. With this release after
1633 at most 10 errors compilation will terminate, regardless of what type of
1634 error they were.
1635 .Sp
1636 Note that you can change the maximum count by defining
1637 \&\f(CW\*(C`PERL_STOP_PARSING_AFTER_N_ERRORS\*(C'\fR to be something else during the
1638 configuration process. For instance
1639 .Sp
1640 .Vb 1
1641 \& ./Configure ... \-Accflags=\*(Aq\-DPERL_STOP_PARSING_AFTER_N_ERRORS=100\*(Aq
1642 .Ve
1643 .Sp
1644 would allow up to 100 errors.
1645 .IP \(bu 4
1646 The API function "my_snprintf" in perlapi now prints a non-dot decimal
1647 point if the perl code it ultimately is called from is in the scope of
1648 \&\f(CW\*(C`use locale\*(C'\fR and the locale in effect calls for that.
1649 .IP \(bu 4
1650 A number of bugs related to capture groups in quantified groups in regular
1651 expression have been fixed, especially in alternations. For example in
1652 a pattern like:
1653 .Sp
1654 .Vb 1
1655 \& "foobazfoobar" =~ /((foo)baz|foo(bar))+/
1656 .Ve
1657 .Sp
1658 the regex variable \f(CW$2\fR will not be "foo" as it once was, it will be undef.
1659 .IP \(bu 4
1660 Bugs with regex backreference operators that are inside of a capture
1661 group have been fixed. For instance:
1662 .Sp
1663 .Vb 1
1664 \& "xa=xaaa" =~ /^(xa|=?\e1a){2}\ez/
1665 .Ve
1666 .Sp
1667 will now correctly not match. [GH #10073 <https://github.com/Perl/perl5/issues/10073>]
1668 .IP \(bu 4
1669 \&\f(CWSSGROW()\fR and \f(CWSSCHECK()\fR have been reworked to ensure that the requested
1670 space is actually allocated. \f(CWSSCHECK()\fR is now an alias for \f(CWSSGROW()\fR.
1671 .SH Acknowledgements
1672 .IX Header "Acknowledgements"
1673 Perl 5.38.0 represents approximately 12 months of development since Perl
1674 5.36.0 and contains approximately 290,000 lines of changes across 1,500
1675 files from 100 authors.
1676 .PP
1677 Excluding auto-generated files, documentation and release tools, there were
1678 approximately 190,000 lines of changes to 970 .pm, .t, .c and .h files.
1679 .PP
1680 Perl continues to flourish into its fourth decade thanks to a vibrant
1681 community of users and developers. The following people are known to have
1682 contributed the improvements that became Perl 5.38.0:
1683 .PP
1684 Alex, Alexander Nikolov, Alex Davies, Andreas König, Andrew Fresh, Andrew
1685 Ruthven, Andy Lester, Aristotle Pagaltzis, Arne Johannessen, A. Sinan Unur,
1686 Bartosz Jarzyna, Bart Van Assche, Benjamin Smith, Bram, Branislav
1687 Zahradník, Brian Greenfield, Bruce Gray, Chad Granum, Chris 'BinGOs'
1688 Williams, chromatic, Clemens Wasser, Craig A. Berry, Dagfinn Ilmari
1689 Mannsåker, Dan Book, danielnachun, Dan Jacobson, Dan Kogai, David Cantrell,
1690 David Golden, David Mitchell, E. Choroba, Ed J, Ed Sabol, Elvin Aslanov,
1691 Eric Herman, Felipe Gasper, Ferenc Erki, Firas Khalil Khana, Florian Weimer,
1692 Graham Knop, Håkon Hægland, Harald Jörg, H.Merijn Brand, Hugo van der
1693 Sanden, James E Keenan, James Raspass, jkahrman, Joe McMahon, Johan Vromans,
1694 Jonathan Stowe, Jon Gentle, Karen Etheridge, Karl Williamson, Kenichi
1695 Ishigaki, Kenneth Ölwing, Kurt Fitzner, Leon Timmermans, Li Linjie, Loren
1696 Merritt, Lukas Mai, Marcel Telka, Mark Jason Dominus, Mark Shelor, Matthew
1697 Horsfall, Matthew O. Persico, Mattia Barbon, Max Maischein, Mohammad S
1698 Anwar, Nathan Mills, Neil Bowers, Nicholas Clark, Nicolas Mendoza, Nicolas
1699 R, Paul Evans, Paul Marquess, Peter John Acklam, Peter Levine, Philippe
1700 Bruhat (BooK), Reini Urban, Renee Baecker, Ricardo Signes, Richard Leach,
1701 Russ Allbery, Scott Baker, Sevan Janiyan, Sidney Markowitz, Sisyphus, Steve
1702 Hay, TAKAI Kousuke, Todd Rinaldo, Tomasz Konojacki, Tom Stellard, Tony Cook,
1703 Tsuyoshi Watanabe, Unicode Consortium, vsfos, Yves Orton, Zakariyya Mughal,
1704 Zefram, 小鸡.
1705 .PP
1706 The list above is almost certainly incomplete as it is automatically
1707 generated from version control history. In particular, it does not include
1708 the names of the (very much appreciated) contributors who reported issues to
1709 the Perl bug tracker.
1710 .PP
1711 Many of the changes included in this version originated in the CPAN modules
1712 included in Perl's core. We're grateful to the entire CPAN community for
1713 helping Perl to flourish.
1714 .PP
1715 For a more complete list of all of Perl's historical contributors, please
1716 see the \fIAUTHORS\fR file in the Perl source distribution.
1717 .SH "Reporting Bugs"
1718 .IX Header "Reporting Bugs"
1719 If you find what you think is a bug, you might check the perl bug database
1720 at <https://github.com/Perl/perl5/issues>. There may also be information at
1721 <http://www.perl.org/>, the Perl Home Page.
1722 .PP
1723 If you believe you have an unreported bug, please open an issue at
1724 <https://github.com/Perl/perl5/issues>. Be sure to trim your bug down to a
1725 tiny but sufficient test case.
1726 .PP
1727 If the bug you are reporting has security implications which make it
1728 inappropriate to send to a public issue tracker, then see
1729 "SECURITY VULNERABILITY CONTACT INFORMATION" in perlsec
1730 for details of how to report the issue.
1731 .SH "Give Thanks"
1732 .IX Header "Give Thanks"
1733 If you wish to thank the Perl 5 Porters for the work we had done in Perl 5,
1734 you can do so by running the \f(CW\*(C`perlthanks\*(C'\fR program:
1735 .PP
1736 .Vb 1
1737 \& perlthanks
1738 .Ve
1739 .PP
1740 This will send an email to the Perl 5 Porters list with your show of thanks.
1741 .SH "SEE ALSO"
1742 .IX Header "SEE ALSO"
1743 The \fIChanges\fR file for an explanation of how to view exhaustive details on
1744 what changed.
1745 .PP
1746 The \fIINSTALL\fR file for how to build Perl.
1747 .PP
1748 The \fIREADME\fR file for general stuff.
1749 .PP
1750 The \fIArtistic\fR and \fICopying\fR files for copyright information.