This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Deprecate above \xFF in bitwise string ops
[perl5.git] / pod / perldelta.pod
CommitLineData
44691e6f
AB
1=encoding utf8
2
3=head1 NAME
4
4ec06e46 5perldelta - what is new for perl v5.27.8
89853d76 6
b5cbfe35 7=head1 DESCRIPTION
89853d76 8
4ec06e46 9This document describes differences between the 5.27.7 release and the 5.27.8
b5cbfe35 10release.
89853d76 11
4ec06e46
CBW
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.
29d69c3c 14
4ec06e46 15=head1 Core Enhancements
9e0909b2 16
ae047103
Z
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
034602eb
KW
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
36 qr/(?script_run: \d+ \b )/x
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
219ba69c
FC
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
4ec06e46 74=head1 Incompatible Changes
15397007 75
3e6fc602
Z
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
ba52ce15
KW
84=head1 Deprecations
85
86=head2 Use of code points over 0xFF in string bitwise operators
87
88Some uses of these already are illegal after a previous deprecation
89cycle. This deprecates the remaining uses. See L<perldeprecation>.
90
4ec06e46 91=head1 Performance Enhancements
8841d380 92
4ec06e46 93=over 4
2707ab55
CBW
94
95=item *
96
d5573933
KW
97The performance of pattern matching C<[[:ascii:]]> and C<[[:^ascii:]]>
98has been improved significantly except on EBCDIC platforms.
2707ab55 99
4ec06e46 100=back
2707ab55 101
4ec06e46 102=head1 Modules and Pragmata
2707ab55 103
4ec06e46 104=head2 New Modules and Pragmata
3752113a 105
4ec06e46 106=over 4
c933e4bb
FC
107
108=item *
109
4ec06e46 110XXX Remove this section if not applicable.
42034324 111
4ec06e46 112=back
b2a6778b 113
4ec06e46 114=head2 Updated Modules and Pragmata
2707ab55 115
4ec06e46 116=over 4
b2a6778b
KE
117
118=item *
119
4ec06e46 120L<XXX> has been upgraded from version A.xx to B.yy.
ad3f654c 121
4ec06e46 122If there was something important to note about this change, include that here.
7358a033 123
56da5534
KW
124=item *
125
126L<Unicode::UCD> has been upgraded from version 0.69 to 0.70.
127
128The function C<num> now accepts an optional parameter to help in
129diagnosing error returns.
130
9a84a9ba
CB
131=item *
132
133L<XSLoader> has been upgraded from version 0.29 to 0.30.
134
135Platforms that use C<mod2fname> to edit the names of loadable libraries now look for
136bootstrap (.bs) files under the correct, non-edited name.
137
8c7aa727
JK
138=item *
139
840d136c 140L<Socket> has been upgraded from version 2.020_04 to 2.027.
8c7aa727 141
4ec06e46 142=back
2707ab55 143
4ec06e46 144=head2 Removed Modules and Pragmata
64b9a139 145
4ec06e46 146=over 4
e6a2e5ca 147
2707ab55 148=item *
b2a6778b 149
4ec06e46 150XXX
b2a6778b 151
4ec06e46 152=back
2707ab55 153
4ec06e46 154=head1 Documentation
2707ab55 155
4ec06e46
CBW
156XXX Changes to files in F<pod/> go here. Consider grouping entries by
157file and be sure to link to the appropriate page, e.g. L<perlfunc>.
2707ab55 158
25219f3f 159=head2 Changes to Existing Documentation
b2a6778b 160
25219f3f
KE
161We have attempted to update the documentation to reflect the changes
162listed in this document. If you find any we have missed, send email
163to L<perlbug@perl.org|mailto:perlbug@perl.org>.
b2a6778b 164
4ec06e46 165Additionally, the following selected changes have been made:
86e03141 166
8e14f284 167=head3 L<perlembed>
86e03141 168
4ec06e46 169=over 4
01d02537 170
4ec06e46 171=item *
01d02537 172
8e14f284
TC
173An example in L<perlembed> used the string value of C<ERRSV> as a
174format string when calling croak(). If that string contains format
175codes such as C<%s> this could crash the program.
176
177This has been changed to a call to croak_sv().
178
179An alternative could have been to supply a trivial format string:
180
181 croak("%s", SvPV_nolen(ERRSV));
182
183or as a special case for C<ERRSV> simply:
184
185 croak(NULL);
4914bebe 186
4ec06e46 187=back
4914bebe 188
0a72295b 189=head3 L<perlfunc>
b2a6778b 190
25219f3f 191=over 4
b2a6778b
KE
192
193=item *
194
0a72295b
A
195Improve the documentation of C<each> with a slightly more
196explicit description of the sharing of iterator state, and with
197caveats regarding the fragility of while-each loops. [perl #132644]
b2a6778b 198
25219f3f 199=back
b2a6778b 200
0a72295b 201=head3 L<perlfunc>, L<perlop>, L<perlsyn>
b2a6778b 202
25219f3f 203=over 4
64b9a139
SH
204
205=item *
206
0a72295b
A
207Improve the documentation of while condition magic in various
208places. [perl #132644]
64b9a139 209
e6a2e5ca 210=back
64b9a139 211
0a72295b 212=head3 L<perlrun>
4ec06e46 213
04f89ea7
Z
214=over 4
215
64b9a139
SH
216=item *
217
0a72295b 218Clarify the documentation of B<< -m >>. [perl #131518]
9fca523d 219
4ec06e46 220=back
9fca523d 221
0a72295b 222=head1 Diagnostics
52e3acf8 223
0a72295b
A
224The following additions or changes have been made to diagnostic output,
225including warnings and fatal error messages. For the complete list of
226diagnostic messages, see L<perldiag>.
4ec06e46 227
0a72295b 228=head2 New Diagnostics
cab9f0b0 229
0a72295b 230=head3 New Errors
4ec06e46
CBW
231
232=over 4
cab9f0b0 233
9deb4e0b
Z
234=item *
235
0a72295b 236L<Can't "goto" into a binary or list expression|perldiag/"Can't E<quot>gotoE<quot> into a binary or list expression">
e509fc38 237
0a72295b
A
238Use of C<goto> to jump into the parameter of a binary or list operator has
239been prohibited, to prevent crashes and stack corruption. [perl #130936]
64b9a139 240
0a72295b 241=back
4ec06e46 242
0a72295b 243=head2 Changes to Existing Diagnostics
4ec06e46 244
e6a2e5ca 245=over 4
64b9a139
SH
246
247=item *
248
0a72295b
A
249The C<< Unable to flush stdout >> error message was missing a trailing
250newline. [debian #875361]
a8d9a219 251
e6a2e5ca
SH
252=back
253
4ec06e46 254=head1 Testing
dea26044 255
4ec06e46
CBW
256Tests were added and changed to reflect the other additions and
257changes in this release. Furthermore, these significant changes were
258made:
a8ba758d 259
25219f3f 260=over 4
a8ba758d 261
ee5287f6
LM
262=item *
263
0a72295b
A
264Allow override of watchdog timer count in F<re/pat_psycho.t>.
265
266This test can take a long time to run, so there is a timer to keep
267this in check (currently, 5 minutes). This commit adds checking
268the environment variable C<< PERL_TEST_TIME_OUT_FACTOR >>; if set,
269the time out setting is multiplied by its value.
59eb8be1 270
4ec06e46 271=back
59eb8be1 272
4ec06e46 273=head1 Platform Support
ee5287f6 274
0a72295b 275=head2 Platform-Specific Notes
e6a2e5ca 276
25219f3f 277=over 4
e6a2e5ca 278
0a72295b 279=item Cygwin
4faa3060 280
0a72295b 281A build with the quadmath library can now be done on Cygwin.
e1b825c1 282
0a72295b 283=item FreeBSD
66d3c925 284
0a72295b
A
285FreeBSD's F<< /usr/share/mk/sys.mk >> specifies C<< -O2 >> for
286architectures other than arm and mips. By default, compile perl
287with the same optimization levels.
66d3c925 288
0a72295b 289=item VMS
4dab62e3 290
0a72295b
A
291Several fix-ups for F<configure.com>, marking function VMS has
292(or doesn't have).
4dab62e3 293
1b16b015 294
4ec06e46 295=back
1b16b015 296
acbb539d
DM
297=head1 Internal Changes
298
299=over 4
300
301=item *
302
303The format of the non-utf8 transliteration table attached to the C<op_pv>
304field of C<OP_TRANS>/C<OP_TRANSR> ops has changed. It's now a
305C<struct OPtrans_map>.
306
307=back
308
0a72295b 309=head1 Selected Bug Fixes
64def2ae 310
4ec06e46 311=over 4
9a40fcb6 312
0a72295b 313=item *
d679c20f 314
f5e05609
Z
315The C<printf> format specifier C<%.0f> no longer rounds incorrectly
316[perl #47602], and now shows the correct sign for a negative zero.
317
318=item *
319
0a72295b 320Fixed a use after free bug in pp_list introduced in 5.27.1. [perl #131954]
30f9405e 321
0a72295b 322=item *
30f9405e 323
0a72295b
A
324Don't stringify numeric first arguments to
325C<< system() >> on Windows or VMS. [perl #132633]
222b5ca9 326
0a72295b 327=item *
222b5ca9 328
0a72295b
A
329Fixed an issue where the error C<< Scalar value @arrayname[0] better
330written as $arrayname >> would give an error C<< Cannot printf Inf with 'c' >>
331when arrayname starts with C<< Inf >>. [perl #132645]
64072da0 332
244d2682
FC
333=item *
334
0a72295b
A
335The Perl implementation of C<< getcwd() >> in C<< Cwd >> in the PathTools
336distribution now behaves the same as XS implementation on errors: it
337returns an error, and sets C<< $! >>. [perl #132648]
4ec06e46 338
0a72295b 339=item *
8af6a5dc 340
0a72295b
A
341Fixed argument counting in multiconcat when concatenating adjacent constants.
342[perl #132646]
998753fe 343
0a72295b 344=item *
998753fe 345
0a72295b
A
346Vivify array elements when putting them on the stack.
347Fixes [perl #8910] (reported in April 2002).
53fff747
Z
348
349=item *
350
0a72295b
A
351Fixed parsing of braced subscript after parens. Fixes [perl #8045]
352(reported in December 2001).
244d2682 353
acbb539d
DM
354=item *
355
356C<tr/non_utf8/long_non_utf8/c> could give the wrong results when the
357length of the replacement character list was greater than 0x7fff.
358
359=item *
360
361C<tr/non_utf8/non_utf8/cd> failed to add the implied
362C<\x{100}-\x{7fffffff}> to the search character list.
363
4ec06e46 364=back
244d2682 365
4ec06e46 366=head1 Known Problems
8f46363a 367
4ec06e46 368=over 4
244d2682 369
aa0c5741
Z
370=item *
371
857320cb
Z
372The bugfix for [perl #2754] in Perl 5.27.7 turned out to cause so much
373trouble on CPAN [perl #132577] that it is being postponed. The bug has
374been restored, so C<exit(0)> in a C<UNITCHECK> or C<CHECK> block now
375once again permits the main program to run, and C<exit(0)> in a C<BEGIN>
376block once again permits C<INIT> blocks to run before exiting. The bug
377will be fixed again for Perl 5.30.
378
25219f3f 379=back
4faa3060 380
4ec06e46 381=head1 Acknowledgements
060724e5 382
4ec06e46 383XXX Generate this with:
060724e5 384
4ec06e46 385 perl Porting/acknowledgements.pl v5.27.7..HEAD
f5b73711 386
44691e6f
AB
387=head1 Reporting Bugs
388
b5cbfe35
S
389If you find what you think is a bug, you might check the perl bug database
390at L<https://rt.perl.org/> . There may also be information at
391L<http://www.perl.org/> , the Perl Home Page.
44691e6f 392
e08634c5
SH
393If you believe you have an unreported bug, please run the L<perlbug> program
394included with your release. Be sure to trim your bug down to a tiny but
395sufficient test case. Your bug report, along with the output of C<perl -V>,
b5cbfe35 396will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
44691e6f 397
87c118b9
DM
398If the bug you are reporting has security implications which make it
399inappropriate to send to a publicly archived mailing list, then see
c0ea3294
SH
400L<perlsec/SECURITY VULNERABILITY CONTACT INFORMATION>
401for details of how to report the issue.
44691e6f 402
390ae6f9
S
403=head1 Give Thanks
404
405If you wish to thank the Perl 5 Porters for the work we had done in Perl 5,
406you can do so by running the C<perlthanks> program:
407
408 perlthanks
409
410This will send an email to the Perl 5 Porters list with your show of thanks.
411
44691e6f
AB
412=head1 SEE ALSO
413
e08634c5
SH
414The F<Changes> file for an explanation of how to view exhaustive details on
415what changed.
44691e6f
AB
416
417The F<INSTALL> file for how to build Perl.
418
419The F<README> file for general stuff.
420
421The F<Artistic> and F<Copying> files for copyright information.
422
423=cut