This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Devel-PPPort Include line numbers in ppphtest.t debug output
[perl5.git] / pod / perl5278delta.pod
CommitLineData
915366d4
A
1=encoding utf8
2
3=head1 NAME
4
5perl5278delta - what is new for perl v5.27.8
6
7=head1 DESCRIPTION
8
9This document describes differences between the 5.27.7 release and the 5.27.8
10release.
11
12If you are upgrading from an earlier release such as 5.27.6, first read
13L<perl5277delta>, which describes differences between 5.27.6 and 5.27.7.
14
15=head1 Core Enhancements
16
17=head2 Close-on-exec flag set atomically
18
19When opening a file descriptor, perl now generally opens it with its
20close-on-exec flag already set, on platforms that support doing so.
21This improves thread safety, because it means that an C<exec> initiated
22by one thread can no longer cause a file descriptor in the process
23of being opened by another thread to be accidentally passed to the
24executed program.
25
26Additionally, perl now sets the close-on-exec flag more reliably, whether
27it does so atomically or not. Most file descriptors were getting the
28flag set, but some were being missed.
29
30=head2 Mixed Unicode scripts are now detectable
31
32A mixture of scripts, such as Cyrillic and Latin, in a string is often
33the sign of a spoofing attack. A new regular expression construct
34now allows for easy detection of these. For example, you can say
35
85a85487 36 qr/(+script_run: \d+ \b )/x
915366d4
A
37
38And the digits matched will all be from the same set of 10. You won't
39get a look-alike digit from a different script that has a different
40value than what it appears to be.
41
42=head2 String- and number-specific bitwise ops are no longer experimental
43
44The new string-specific (C<&. |. ^. ~.>) and number-specific (C<& | ^ ~>)
45bitwise operators introduced in Perl 5.22 are no longer experimental.
46Because the number-specific ops are spelled the same way as the existing
47operators that choose their behaviour based on their operands, these
48operators must still be enabled via the "bitwise" feature, in either of
49these two ways:
50
51 use feature "bitwise";
52
53 use v5.28; # "bitwise" now included
54
55They are also now enabled by the B<-E> command-line switch.
56
57The "bitwise" feature no longer emits a warning. Existing code that
58disables the "experimental::bitwise" warning category that the feature
59previously used will continue to work.
60
61One caveat that module authors ought to be aware of is that the numeric
62operators now pass a fifth TRUE argument to overload methods. Any methods
63that check the number of operands may croak if they do not expect so many.
64XS authors in particular should be aware that this:
65
66 SV *
67 bitop_handler (lobj, robj, swap)
68
69may need to be changed to this:
70
71 SV *
72 bitop_handler (lobj, robj, swap, ...)
73
74=head1 Incompatible Changes
75
76=head2 Smartmatch and switch reversion
77
78The changes to the experimental smart match operator (C<~~>) and switch
79(C<given>/C<when>) constructs that were made in Perl 5.27.7 have been
80reverted due to the extent of the trouble caused to CPAN modules.
81It is expected that smartmatch will be changed again in the future,
82but preceded by some kind of explicit deprecation.
83
84=head2 Subroutine attribute and signature order
85
86The experimental subroutine signatures feature has been changed so that
87subroutine attributes must now come before the signature rather than
88after. This is because attributes like C<:lvalue> can affect the
89compilation of code within the signature, for example:
90
91 sub f :lvalue ($a = do { $x = "abc"; return substr($x,0,1)}) { ...}
92
93Note that this the second time they have been flipped:
94
9264a512
DM
95 sub f :lvalue ($a, $b) { ... }; # 5.20; 5.28 onwards
96 sub f ($a, $b) :lvalue { ... }; # 5.22 - 5.26
915366d4
A
97
98=head1 Deprecations
99
100=head2 Use of code points over 0xFF in string bitwise operators
101
102Some uses of these already are illegal after a previous deprecation
103cycle. This deprecates the remaining uses. See L<perldeprecation>.
104
105=head2 Use of unescaped C<"{"> immediately after a C<"("> in regular
106expression patterns
107
108Using unescaped left braces is officially deprecated everywhere, but it
109is not enforced in contexts where their use does not interfere with
110expected extensions to the language. A deprecation is added in this
111release when the brace appears immediately after an opening parenthesis.
112Before this, even if the brace was part of a legal quantifier, it was
113not interpreted as such, but as the literal characters, unlike other
114quantifiers that follow a C<"("> which are considered errors. Now,
115their use will raise a deprecation message, unless turned off.
116
117=head1 Performance Enhancements
118
119=over 4
120
121=item *
122
123The performance of pattern matching C<[[:ascii:]]> and C<[[:^ascii:]]>
124has been improved significantly except on EBCDIC platforms.
125
126=back
127
128=head1 Modules and Pragmata
129
130=head2 Updated Modules and Pragmata
131
132=over 4
133
134=item *
135
136L<B> has been upgraded from version 1.73 to 1.74.
137
138=item *
139
140L<B::Deparse> has been upgraded from version 1.46 to 1.47.
141
142=item *
143
144L<Data::Dumper> has been upgraded from version 2.169 to 2.170.
145
146=item *
147
148L<Devel::PPPort> has been upgraded from version 3.37 to 3.38.
149
150=item *
151
152L<Digest::SHA> has been upgraded from version 6.00 to 6.01.
153
154=item *
155
156L<Encode> has been upgraded from version 2.93 to 2.94.
157
158=item *
159
160L<ExtUtils::Miniperl> has been upgraded from version 1.07 to 1.08.
161
162=item *
163
164L<feature> has been upgraded from version 1.50 to 1.51.
165
166=item *
167
168L<File::Spec> has been upgraded from version 3.71 to 3.72.
169
170=item *
171
172L<JSON::PP> has been upgraded from version 2.97000 to 2.97001.
173
174=item *
175
176L<Module::CoreList> has been upgraded from version 5.20171220 to 5.20180120.
177
178=item *
179
180L<Opcode> has been upgraded from version 1.42 to 1.43.
181
182=item *
183
184L<overload> has been upgraded from version 1.29 to 1.30.
185
186=item *
187
188L<Pod::Functions> has been upgraded from version 1.12 to 1.13.
189
190=item *
191
192L<Pod::Html> has been upgraded from version 1.23 to 1.24.
193
194=item *
195
196The podlators bundle has been upgraded from version 4.09 to 4.10.
197
198Man page references and function names now follow the Linux man page
199formatting standards, instead of the Solaris standard.
200
201=item *
202
203L<Socket> has been upgraded from version 2.020_04 to 2.027.
204
205=item *
206
207L<Time::HiRes> has been upgraded from version 1.9748 to 1.9752.
208
209=item *
210
211L<Unicode::UCD> has been upgraded from version 0.69 to 0.70.
212
213The function C<num> now accepts an optional parameter to help in
214diagnosing error returns.
215
216=item *
217
218L<utf8> has been upgraded from version 1.20 to 1.21.
219
220=item *
221
222L<warnings> has been upgraded from version 1.39 to 1.40.
223
224=item *
225
226L<XSLoader> has been upgraded from version 0.29 to 0.30.
227
228Platforms that use C<mod2fname> to edit the names of loadable
229libraries now look for bootstrap (.bs) files under the correct,
230non-edited name.
231
232=back
233
234=head1 Documentation
235
236=head2 Changes to Existing Documentation
237
238We have attempted to update the documentation to reflect the changes
239listed in this document. If you find any we have missed, send email
240to L<perlbug@perl.org|mailto:perlbug@perl.org>.
241
242Additionally, the following selected changes have been made:
243
244=head3 L<perlembed>
245
246=over 4
247
248=item *
249
250An example in L<perlembed> used the string value of C<ERRSV> as a
251format string when calling croak(). If that string contains format
252codes such as C<%s> this could crash the program.
253
254This has been changed to a call to croak_sv().
255
256An alternative could have been to supply a trivial format string:
257
258 croak("%s", SvPV_nolen(ERRSV));
259
260or as a special case for C<ERRSV> simply:
261
262 croak(NULL);
263
264=back
265
266=head3 L<perlfunc>
267
268=over 4
269
270=item *
271
272Improve the documentation of C<each> with a slightly more
273explicit description of the sharing of iterator state, and with
274caveats regarding the fragility of while-each loops. [perl #132644]
275
276=back
277
278=head3 L<perlfunc>, L<perlop>, L<perlsyn>
279
280=over 4
281
282=item *
283
284Improve the documentation of while condition magic in various
285places. [perl #132644]
286
287=back
288
289=head3 L<perlrun>
290
291=over 4
292
293=item *
294
295Clarify the documentation of B<< -m >>. [perl #131518]
296
297=back
298
299=head1 Diagnostics
300
301The following additions or changes have been made to diagnostic output,
302including warnings and fatal error messages. For the complete list of
303diagnostic messages, see L<perldiag>.
304
305=head2 New Diagnostics
306
307=head3 New Errors
308
309=over 4
310
311=item *
312
313L<Can't "goto" into a binary or list expression|perldiag/"Can't E<quot>gotoE<quot> into a binary or list expression">
314
315Use of C<goto> to jump into the parameter of a binary or list operator has
316been prohibited, to prevent crashes and stack corruption. [perl #130936]
317
318=back
319
320=head2 Changes to Existing Diagnostics
321
322=over 4
323
324=item *
325
326The C<< Unable to flush stdout >> error message was missing a trailing
327newline. [debian #875361]
328
329=back
330
331=head1 Testing
332
333Tests were added and changed to reflect the other additions and
334changes in this release. Furthermore, these significant changes were
335made:
336
337=over 4
338
339=item *
340
341Allow override of watchdog timer count in F<re/pat_psycho.t>.
342
343This test can take a long time to run, so there is a timer to keep
344this in check (currently, 5 minutes). This commit adds checking
345the environment variable C<< PERL_TEST_TIME_OUT_FACTOR >>; if set,
346the time out setting is multiplied by its value.
347
348=back
349
350=head1 Platform Support
351
352=head2 Platform-Specific Notes
353
354=over 4
355
356=item Cygwin
357
358A build with the quadmath library can now be done on Cygwin.
359
360=item FreeBSD
361
362FreeBSD's F<< /usr/share/mk/sys.mk >> specifies C<< -O2 >> for
363architectures other than arm and mips. By default, compile perl
364with the same optimization levels.
365
366=item VMS
367
368Several fix-ups for F<configure.com>, marking function VMS has
369(or doesn't have).
370
371
372=back
373
374=head1 Internal Changes
375
376=over 4
377
378=item *
379
380The format of the non-utf8 transliteration table attached to the C<op_pv>
381field of C<OP_TRANS>/C<OP_TRANSR> ops has changed. It's now a
382C<struct OPtrans_map>.
383
384=back
385
386=head1 Selected Bug Fixes
387
388=over 4
389
390=item *
391
392The C<printf> format specifier C<%.0f> no longer rounds incorrectly
393[perl #47602], and now shows the correct sign for a negative zero.
394
395=item *
396
397Fixed a use after free bug in pp_list introduced in 5.27.1. [perl #131954]
398
399=item *
400
401Don't stringify numeric first arguments to
402C<< system() >> on Windows or VMS. [perl #132633]
403
404=item *
405
406Fixed an issue where the error C<< Scalar value @arrayname[0] better
407written as $arrayname >> would give an error C<< Cannot printf Inf with 'c' >>
408when arrayname starts with C<< Inf >>. [perl #132645]
409
410=item *
411
412The Perl implementation of C<< getcwd() >> in C<< Cwd >> in the PathTools
413distribution now behaves the same as XS implementation on errors: it
414returns an error, and sets C<< $! >>. [perl #132648]
415
416=item *
417
418Fixed argument counting in multiconcat when concatenating adjacent constants.
419[perl #132646]
420
421=item *
422
423Vivify array elements when putting them on the stack.
424Fixes [perl #8910] (reported in April 2002).
425
426=item *
427
428Fixed parsing of braced subscript after parens. Fixes [perl #8045]
429(reported in December 2001).
430
431=item *
432
433C<tr/non_utf8/long_non_utf8/c> could give the wrong results when the
434length of the replacement character list was greater than 0x7fff.
435
436=item *
437
438C<tr/non_utf8/non_utf8/cd> failed to add the implied
439C<\x{100}-\x{7fffffff}> to the search character list.
440
441=back
442
443=head1 Known Problems
444
445=over 4
446
447=item *
448
449The bugfix for [perl #2754] in Perl 5.27.7 turned out to cause so much
450trouble on CPAN [perl #132577] that it is being postponed. The bug has
451been restored, so C<exit(0)> in a C<UNITCHECK> or C<CHECK> block now
452once again permits the main program to run, and C<exit(0)> in a C<BEGIN>
453block once again permits C<INIT> blocks to run before exiting. The bug
454will be fixed again for Perl 5.30.
455
456=back
457
458=head1 Acknowledgements
459
460Perl 5.27.8 represents approximately 4 weeks of development since Perl
4615.27.7 and contains approximately 33,000 lines of changes across 290 files
462from 17 authors.
463
464Excluding auto-generated files, documentation and release tools, there were
465approximately 25,000 lines of changes to 160 .pm, .t, .c and .h files.
466
467Perl continues to flourish into its third decade thanks to a vibrant
468community of users and developers. The following people are known to have
469contributed the improvements that became Perl 5.27.8:
470
471Abigail, Chris 'BinGOs' Williams, Craig A. Berry, Dagfinn Ilmari Mannsåker,
472David Mitchell, Father Chrysostomos, James E Keenan, Karen Etheridge, Karl
473Williamson, Niko Tyni, Pali, Peter John Acklam, Scott Lanning, Tomasz
474Konojacki, Tom Hukins, Tony Cook, Zefram.
475
476The list above is almost certainly incomplete as it is automatically
477generated from version control history. In particular, it does not include
478the names of the (very much appreciated) contributors who reported issues to
479the Perl bug tracker.
480
481Many of the changes included in this version originated in the CPAN modules
482included in Perl's core. We're grateful to the entire CPAN community for
483helping Perl to flourish.
484
485For a more complete list of all of Perl's historical contributors, please
486see the F<AUTHORS> file in the Perl source distribution.
487
488=head1 Reporting Bugs
489
490If you find what you think is a bug, you might check the perl bug database
491at L<https://rt.perl.org/> . There may also be information at
492L<http://www.perl.org/> , the Perl Home Page.
493
494If you believe you have an unreported bug, please run the L<perlbug> program
495included with your release. Be sure to trim your bug down to a tiny but
496sufficient test case. Your bug report, along with the output of C<perl -V>,
497will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
498
499If the bug you are reporting has security implications which make it
500inappropriate to send to a publicly archived mailing list, then see
501L<perlsec/SECURITY VULNERABILITY CONTACT INFORMATION>
502for details of how to report the issue.
503
504=head1 Give Thanks
505
506If you wish to thank the Perl 5 Porters for the work we had done in Perl 5,
507you can do so by running the C<perlthanks> program:
508
509 perlthanks
510
511This will send an email to the Perl 5 Porters list with your show of thanks.
512
513=head1 SEE ALSO
514
515The F<Changes> file for an explanation of how to view exhaustive details on
516what changed.
517
518The F<INSTALL> file for how to build Perl.
519
520The F<README> file for general stuff.
521
522The F<Artistic> and F<Copying> files for copyright information.
523
524=cut