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 / perl5277delta.pod
CommitLineData
4ec06e46
CBW
1=encoding utf8
2
3=head1 NAME
4
5perl5277delta - what is new for perl v5.27.7
6
7=head1 DESCRIPTION
8
9This document describes differences between the 5.27.6 release and the 5.27.7
10release.
11
12If you are upgrading from an earlier release such as 5.27.5, first read
13L<perl5276delta>, which describes differences between 5.27.5 and 5.27.6.
14
15=head1 Core Enhancements
16
17=head2 The C<sprintf> C<%j> format size modifier is now available with
18pre-C99 compilers
19
20The actual size used depends on the platform, so remains unportable.
21
22=head1 Incompatible Changes
23
24=head2 Smartmatch and switch simplification
25
26The experimental smart match operator (C<~~>) and switch
27(C<given>/C<when>) constructs have been drastically simplified, in a
28way that will require most uses of them to be updated.
29
30The smart match operator no longer has its large table of matching rules.
31Instead there is just one rule: the right-hand operand must overload
32the operator. Overloaded objects now bear the entire responsibility
33for determining what kind of match to perform. The operator also no
34longer implicitly enreferences certain kinds of operand (such as arrays);
35instead the operands get regular scalar context.
36
37The C<when> construct no longer has its complicated rules about how
38to treat its argument. Instead it has been split into two distinct
39constructs. C<whereso> always uses the argument as a truth value,
40and C<whereis> always smart matches. Like the smart match operator,
41these also no longer implicitly enreference certain kinds of argument,
42instead supplying regular scalar context.
43
44The C<default> construct, which was misleading and essentially useless,
45has been removed.
46
47The C<given> construct also no longer implicitly enreferences certain
48kinds of arguments, instead supplying regular scalar context. In this
49case, the implicit enreferencement was undocumented anyway.
50
51Flow control of switch constructs has been unified with loop flow
52control. The concept of "topicalizer" (referring to a C<given> block
53or a C<foreach> loop acting on C<$_>) has been abolished. A C<given>
54construct now counts as a one-iteration loop, so responds to the loop
55control keywords. The C<break> keyword has consequently been removed,
56in favour of using C<next> or C<last> to exit a C<given>. The implicit
57jump at the end of a C<when> block is now a C<next>, and so is applicable
58not just to C<given> and some kinds of C<foreach> but to any loop.
59
60It is known that these changes will break some users of L<autodie>,
61the documentation of which has long recommended some uses of these
62experimental features that are not portable across these changes.
63
64=head2 Over-radix digits in floating point literals
65
66Octal and binary floating point literals used to permit any hexadecimal
67digit to appear after the radix point. The digits are now restricted
68to those appropriate for the radix, as digits before the radix point
69always were.
70
71=head2 Return type of C<unpackstring()>
72
73The return types of the C API functions C<unpackstring()> and
74C<unpack_str()> have changed from C<I32> to C<SSize_t>, in order to
75accommodate datasets of more than two billion items.
76
77=head1 Deprecations
78
79=head2 Assignment to C<$[> will be fatal in Perl 5.30
80
81Assigning a non-zero value to L<C<$[>|perlvar/$[> has been deprecated
82since Perl 5.12, but was never given a deadline for removal. This has
83now been scheduled for Perl 5.30.
84
85=head2 hostname() won't accept arguments in Perl 5.32
86
87Passing arguments to C<Sys::Hostname::hostname()> was already deprecated,
88but didn't have a removal date. This has now been scheduled for Perl
895.32. [perl #124349]
90
91=head2 Module removals
92
93=over
94
95=item L<Locale::Codes> and its associated Country, Currency and Language modules
96
97=back
98
99=head1 Modules and Pragmata
100
101=head2 Updated Modules and Pragmata
102
103=over 4
104
105=item *
106
107L<arybase> has been upgraded from version 0.14 to 0.15.
108
109=item *
110
111L<B> has been upgraded from version 1.72 to 1.73.
112
113=item *
114
115L<B::Debug> has been upgraded from version 1.25 to 1.26.
116NOTE: L<B::Debug> is deprecated and may be removed from a future version of Perl.
117
118=item *
119
120L<B::Deparse> has been upgraded from version 1.45 to 1.46.
121
122=item *
123
124L<Carp> has been upgraded from version 1.44 to 1.45.
125
126=item *
127
128L<Compress::Raw::Zlib> has been upgraded from version 2.075 to 2.076.
129
130=item *
131
132L<CPAN> has been upgraded from version 2.18 to 2.20.
133
134=item *
135
136L<Data::Dumper> has been upgraded from version 2.167_02 to 2.169.
137Quoting of glob names now obeys the Useqq option [perl #119831].
138Attempts to set an option to C<undef> through a combined getter/setter
139method are no longer mistaken for getter calls [perl #113090].
140
141=item *
142
143L<Devel::PPPort> has been upgraded from version 3.36 to 3.37.
144
145=item *
146
147L<Digest::SHA> has been upgraded from version 5.98 to 6.00.
148
149=item *
150
151L<DynaLoader> has been upgraded from version 1.44 to 1.45.
152Its documentation now shows the use of C<__PACKAGE__> and direct object
153syntax [perl #132247].
154
155=item *
156
157L<experimental> has been upgraded from version 0.017 to 0.019.
158
159=item *
160
161L<ExtUtils::CBuilder> has been upgraded from version 0.280229 to 0.280230.
162
163=item *
164
165L<ExtUtils::Typemaps> has been upgraded from version 3.36 to 3.37.
166
167=item *
168
169L<feature> has been upgraded from version 1.49 to 1.50.
170
171=item *
172
173L<File::Fetch> has been upgraded from version 0.54 to 0.56.
174
175=item *
176
177L<File::Spec> has been upgraded from version 3.70 to 3.71.
178
179=item *
180
181L<Filter::Util::Call> has been upgraded from version 1.57 to 1.58.
182
183=item *
184
185L<GDBM_File> has been upgraded from version 1.16 to 1.17.
186Its documentation now explains that C<each> and C<delete> don't mix in
187hashes tied to this module [perl #117449].
188It will now retry opening with an acceptable block size if asking gdbm
189to default the block size failed [perl #119623].
190
191=item *
192
193L<JSON::PP> has been upgraded from version 2.94 to 2.97000.
194
195=item *
196
197L<Locale::Codes> has been upgraded from version 3.54 to 3.55
198
199B<NOTE>: L<Locale::Codes> scheduled to be removed from core in Perl 5.30.
200
201=item *
202
203L<Module::CoreList> has been upgraded from version 5.20171120 to 5.20171220.
204
205=item *
206
207L<Opcode> has been upgraded from version 1.41 to 1.42.
208
209=item *
210
211L<overload> has been upgraded from version 1.28 to 1.29.
212
213=item *
214
215L<Pod::Functions> has been upgraded from version 1.11 to 1.12.
216
217=item *
218
219L<Pod::Html> has been upgraded from version 1.2203 to 1.23.
220A title for the HTML document will now be automatically generated by
221default from a "NAME" section in the POD document, as it used to be
222before the module was rewritten to use L<Pod::Simple::XHTML> to do the
223core of its job. [perl #110520]
224
225=item *
226
227L<POSIX> has been upgraded from version 1.80 to 1.81.
228
229=item *
230
231L<Sys::Hostname> has been upgraded from version 1.21 to 1.22.
232
233=item *
234
235L<Test::Simple> has been upgraded from version 1.302111 to 1.302120.
236
237=item *
238
239L<threads> has been upgraded from version 2.19 to 2.21.
240The documentation now better describes the problems that arise when
241returning values from threads, and no longer warns about creating threads
242in C<BEGIN> blocks. [perl #96538]
243
244=item *
245
246L<threads::shared> has been upgraded from version 1.57 to 1.58.
247
248=item *
249
250L<Time::HiRes> has been upgraded from version 1.9747 to 1.9748.
251
252=item *
253
254L<Time::Piece> has been upgraded from version 1.3202 to 1.3203.
255
256=item *
257
258L<Unicode::Collate> has been upgraded from version 1.23 to 1.25.
259
260=item *
261
262L<Unicode::UCD> has been upgraded from version 0.68 to 0.69.
263
264=item *
265
266L<warnings> has been upgraded from version 1.38 to 1.39.
267It now includes new functions with names ending in C<_at_level>, allowing
268callers to specify the exact call frame. [perl #132468]
269
270=item *
271
272L<XSLoader> has been upgraded from version 0.28 to 0.29.
273Its documentation now shows the use of C<__PACKAGE__>, and direct object
274syntax for example C<DynaLoader> usage [perl #132247].
275
276=back
277
278=head1 Documentation
279
280=head2 Changes to Existing Documentation
281
282We have attempted to update the documentation to reflect the changes
283listed in this document. If you find any we have missed, send email
284to L<perlbug@perl.org|mailto:perlbug@perl.org>.
285
286Additionally, the following selected changes have been made:
287
288=head3 L<perlapi>
289
290The API functions C<perl_parse()>, C<perl_run()>, and C<perl_destruct()>
291are now documented comprehensively, where previously the only
292documentation was a reference to the L<perlembed> tutorial.
293
294The documentation of C<newGIVENOP()> has been belatedly updated to
295account for the removal of lexical C<$_>.
296
297The API functions C<newCONSTSUB()> and C<newCONSTSUB_flags()> are
298documented much more comprehensively than before.
299
300=head3 L<perlop>
301
302The general explanation of operator precedence and associativity has
303been corrected and clarified. [perl #127391]
304
305The documentation for the C<\> referencing operator now explains the
306unusual context that it supplies to its operand. [perl #131061]
307
308=head3 L<perlsyn>
309
310The means to disambiguate between code blocks and hash constructors,
311already documented in L<perlref>, are now documented in L<perlsyn> too.
312[perl #130958]
313
314=head3 L<perlfunc>
315
316There is now a note that warnings generated by built-in functions are
317documented in L<perldiag> and L<warnings>. [perl #116080]
318
319The documentation for the C<exists> operator no longer says that
320autovivification behaviour "may be fixed in a future release".
321We've determined that we're not going to change the default behaviour.
322[perl #127712]
323
324A couple of small details in the documentation for the C<bless> operator
325have been clarified. [perl #124428]
326
327The description of C<@INC> hooks in the documentation for C<require>
328has been corrected to say that filter subroutines receive a useless
329first argument. [perl #115754]
330
331The documentation of C<ref> has been rewritten for clarity.
332
333The documentation of C<use> now explains what syntactically qualifies
334as a version number for its module version checking feature.
335
336The documentation of C<warn> has been updated to reflect that since Perl
3375.14 it has treated complex exception objects in a manner equivalent
338to C<die>. [perl #121372]
339
340The documentation of C<die> and C<warn> has been revised for clarity.
341
342=head3 L<perluniprops>
343
344For each binary table or property, the documentation now includes which
345characters in the range C<\x00-\xFF> it matches, as well as a list of
346the first few ranges of code points matched above that.
347
348=head3 L<perlobj>
349
350The documentation about C<DESTROY> methods has been corrected, updated,
351and revised, especially in regard to how they interact with exceptions.
352[perl #122753]
353
354=head3 L<perlsec>
355
356The documentation about set-id scripts has been updated and revised.
357[perl #74142]
358
359A section about using C<sudo> to run Perl scripts has been added.
360
361=head3 L<perlembed>
362
363The examples in L<perlembed> have been made more portable in the way
364they exit, and the example that gets an exit code from the embedded Perl
365interpreter now gets it from the right place. The examples that pass
366a constructed argv to Perl now show the mandatory null C<argv[argc]>.
367
368=head3 L<perldebguts>
369
370The description of the conditions under which C<DB::sub()> will be called
371has been clarified. [perl #131672]
372
373=head3 L<perlintern>
374
375The internal functions C<newXS_len_flags()> and C<newATTRSUB_x()> are
376now documented.
377
378=head3 L<perlgit>
379
380The precise rules for identifying C<smoke-me> branches are now stated.
381
382=head1 Diagnostics
383
384The following additions or changes have been made to diagnostic output,
385including warnings and fatal error messages. For the complete list of
386diagnostic messages, see L<perldiag>.
387
388=head2 New Diagnostics
389
390=head3 New Errors
391
392=over 4
393
394=item *
395
396L<Can't "goto" into a "given" block|perldiag/"Can't E<quot>gotoE<quot> into a E<quot>givenE<quot> block">
397
398(F) A "goto" statement was executed to jump into the middle of a C<given>
399block. You can't get there from here. See L<perlfunc/goto>.
400
401=back
402
403=head3 New Warnings
404
405=over 4
406
407=item *
408
409L<Old package separator used in string|perldiag/"Old package separator used in string">
410
411(W syntax) You used the old package separator, "'", in a variable
412named inside a double-quoted string; e.g., C<"In $name's house">. This
413is equivalent to C<"In $name::s house">. If you meant the former, put
414a backslash before the apostrophe (C<"In $name\'s house">).
415
416=back
417
418=head2 Changes to Existing Diagnostics
419
420=over 4
421
422=item *
423
424The warning about useless use of a concatenation operator in void context
425is now generated for expressions with multiple concatenations, such as
426C<$a.$b.$c>, which used to mistakenly not warn. [perl #6997]
427
428=item *
429
430Warnings that a variable or subroutine "masks earlier declaration in same
431...", or that an C<our> variable has been redeclared, have been moved to a
432new warnings category "shadow". Previously they were in category "misc".
433
434=item *
435
436The deprecation warning from C<Sys::Hostname::hostname()> saying that
437it doesn't accept arguments now states the Perl version in which the
438warning will be upgraded to an error. [perl #124349]
439
440=item *
441
442The L<perldiag> entry for the error regarding a set-id script has been
443expanded to make clear that the error is reporting a specific security
444vulnerability, and to advise how to fix it.
445
446=back
447
448=head1 Configuration and Compilation
449
450=over 4
451
452=item *
453
454Where an HTML version of the doucmentation is installed, the HTML
455documents now use relative links to refer to each other. Links from
456the index page of L<perlipc> to the individual section documents are
457now correct. [perl #110056]
458
459=back
460
461=head1 Platform Support
462
463=head2 Platform-Specific Notes
464
465=over 4
466
467=item Windows
468
469We now set C<$Config{libpth}> correctly for 64-bit builds using Visual C++
470versions earlier than 14.1.
471
472=back
473
474=head1 Internal Changes
475
476=over 4
477
478=item *
479
480XS modules can now automatically get reentrant versions of system
481functions on threaded perls.
482
483By saying
484
485 #define PERL_REENTRANT
486
487near the beginning of an C<XS> file, it will be compiled so that
488whatever reentrant functions perl knows about on that system will
489automatically and invisibly be used instead of the plain, non-reentrant
490versions. For example, if you write C<getpwnam()> in your code, on a
491system that has C<pwnam_r()> all calls to the former will be translated
492invisibly into the latter. This does not happen except on threaded
493perls, as they aren't needed otherwise. Be aware that which functions
494have reentrant versions varies from system to system.
495
496=item *
497
498The C<PERL_NO_OP_PARENT> build define is no longer supported, which means
499that perl is now always built with C<PERL_OP_PARENT> enabled.
500
501=back
502
503=head1 Selected Bug Fixes
504
505=over 4
506
507=item *
508
509C<pack> and C<unpack> can now handle repeat counts and lengths that
510exceed two billion. [perl #119367]
511
512=item *
513
514Digits past the radix point in octal and binary floating point literals
515now have the correct weight on platforms where a floating point
516significand doesn't fit into an integer type.
517
518=item *
519
520C<exit(0)> in a C<UNITCHECK> or C<CHECK> block no longer permits the
521main program to run, and C<exit(0)> in a C<BEGIN> block no longer permits
522C<INIT> blocks to run before exiting. [perl #2754]
523
524=item *
525
526The canonical truth value no longer has a spurious special meaning as
527a callable. It used to be a magic placeholder for a missing C<import>
528or C<unimport> method. It is now treated like any other string C<1>.
529[perl #126042]
530
531=item *
532
533C<system> now reduces its arguments to strings in the parent process, so
534any effects of stringifying them (such as overload methods being called
535or warnings being emitted) are visible in the way the program expects.
536[perl #121105]
537
538=item *
539
540The C<readpipe()> built-in function now checks at compile time that
541it has only one parameter expression, and puts it in scalar context,
542thus ensuring that it doesn't corrupt the stack at runtime. [perl #4574]
543
544=item *
545
546C<sort> now performs correct reference counting when aliasing C<$a> and
547C<$b>, thus avoiding premature destruction and leakage of scalars if they
548are re-aliased during execution of the sort comparator. [perl #92264]
549
550=item *
551
552C<reverse> with no operand, reversing C<$_> by default, is no longer in
553danger of corrupting the stack. [perl #132544]
554
555=item *
556
557C<exec>, C<system>, et al are no longer liable to have their argument
558lists corrupted by reentrant calls and by magic such as tied scalars.
559[perl #129888]
560
561=item *
562
563Perl's own C<malloc> no longer gets confused by attempts to allocate
564more than a gigabyte on a 64-bit platform. [perl #119829]
565
566=item *
567
568Stacked file test operators in a sort comparator expression no longer
569cause a crash. [perl #129347]
570
571=item *
572
573An identity C<tr///> transformation on a reference is no longer mistaken
574for that reference for the purposes of deciding whether it can be
575assigned to. [perl #130578]
576
577=item *
578
579Lengthy hexadecimal, octal, or binary floating point literals no
580longer cause undefined behaviour when parsing digits that are of such
581low significance that they can't affect the floating point value.
582[perl #131894]
583
584=item *
585
586C<open $$scalarref...> and similar invocations no longer leak the file
587handle. [perl #115814]
588
589=item *
590
591Some convoluted kinds of regexp no longer cause an arithmetic overflow
592when compiled. [perl #131893]
593
594=item *
595
596The default typemap, by avoiding C<newGVgen>, now no longer leaks when
597XSUBs return file handles (C<PerlIO *> or C<FILE *>). [perl #115814]
598
599=item *
600
601Creating a C<BEGIN> block as an XS subroutine with a prototype no longer
602crashes because of the early freeing of the subroutine.
603
604=back
605
606=head1 Acknowledgements
607
608Perl 5.27.7 represents approximately 4 weeks of development since Perl
6095.27.6 and contains approximately 21,000 lines of changes across 580 files
610from 21 authors.
611
612Excluding auto-generated files, documentation and release tools, there were
613approximately 12,000 lines of changes to 360 .pm, .t, .c and .h files.
614
615Perl continues to flourish into its third decade thanks to a vibrant
616community of users and developers. The following people are known to have
617contributed the improvements that became Perl 5.27.7:
618
619Aaron Crane, Ævar Arnfjörð Bjarmason, Alberto Simões, Chris 'BinGOs'
620Williams, Craig A. Berry, Dagfinn Ilmari Mannsåker, David Mitchell, Father
621Chrysostomos, James E Keenan, Jarkko Hietaniemi, J. Nick Koston, Karen
622Etheridge, Karl Williamson, Marco Fontani, Nicolas R., Sawyer X, Steve Hay,
623Sullivan Beck, Tony Cook, Yves Orton, Zefram.
624
625The list above is almost certainly incomplete as it is automatically
626generated from version control history. In particular, it does not include
627the names of the (very much appreciated) contributors who reported issues to
628the Perl bug tracker.
629
630Many of the changes included in this version originated in the CPAN modules
631included in Perl's core. We're grateful to the entire CPAN community for
632helping Perl to flourish.
633
634For a more complete list of all of Perl's historical contributors, please
635see the F<AUTHORS> file in the Perl source distribution.
636
637=head1 Reporting Bugs
638
639If you find what you think is a bug, you might check the perl bug database
640at L<https://rt.perl.org/> . There may also be information at
641L<http://www.perl.org/> , the Perl Home Page.
642
643If you believe you have an unreported bug, please run the L<perlbug> program
644included with your release. Be sure to trim your bug down to a tiny but
645sufficient test case. Your bug report, along with the output of C<perl -V>,
646will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
647
648If the bug you are reporting has security implications which make it
649inappropriate to send to a publicly archived mailing list, then see
650L<perlsec/SECURITY VULNERABILITY CONTACT INFORMATION>
651for details of how to report the issue.
652
653=head1 Give Thanks
654
655If you wish to thank the Perl 5 Porters for the work we had done in Perl 5,
656you can do so by running the C<perlthanks> program:
657
658 perlthanks
659
660This will send an email to the Perl 5 Porters list with your show of thanks.
661
662=head1 SEE ALSO
663
664The F<Changes> file for an explanation of how to view exhaustive details on
665what changed.
666
667The F<INSTALL> file for how to build Perl.
668
669The F<README> file for general stuff.
670
671The F<Artistic> and F<Copying> files for copyright information.
672
673=cut