This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
epigraph for 5.17.0
[perl5.git] / pod / perldelta.pod
CommitLineData
44691e6f
AB
1=encoding utf8
2
3=head1 NAME
4
f9001595 5perldelta - what is new for perl v5.17.0
27f00e3d 6
f9001595 7=head1 DESCRIPTION
2630d42b 8
f9001595
RS
9This document describes differences between the 5.16.0 release and
10the 5.17.0 release.
7620cb10 11
f9001595 12If you are upgrading from an earlier release such as 5.16.0, first read
4ea27089 13L<perl5160delta>, which describes differences between 5.14.0 and
f9001595 145.16.0.
d7c042c9 15
f9001595 16=head1 Incompatible Changes
2e2b2571 17
417a992d
Z
18=head2 qw(...) can no longer be used as parentheses
19
20C<qw> lists used to fool the parser into thinking they were always
21surrounded by parentheses. This permitted some surprising constructions
22such as C<foreach $x qw(a b c) {...}>, which should really be written
23C<foreach $x (qw(a b c)) {...}>. These would sometimes get the lexer into
24the wrong state, so they didn't fully work, and the similar C<foreach qw(a
25b c) {...}> that one might expect to be permitted never worked at all.
26
27This side effect of C<qw> has now been abolished. It has been deprecated
28since Perl 5.13.11. It is now necessary to use real parentheses
29everywhere that the grammar calls for them.
30
075b9d7d
KW
31=head2 C<\s> in regular expressions now matches a Vertical Tab (experimental)
32
33This is an experiment early in the development cycle to see what
34repercussions arise from this change. It may well be that we decide
35to require a C<"use feature"> to activate this behavior. Because
36of the experimental nature of this, which may be reversed, the
37documentation has not been changed to reflect it.
38
f9001595 39=head1 Deprecations
cadced9f 40
30608892
Z
41=head2 Unescaped braces in regexps
42
43Literal unescaped C<{> in regular expressions is now deprecated. Every
44brace character should be either escaped (by a preceding backslash) or
45part of a construct where it's a metacharacter. This catches likely typos
46such as C</f{,3}/>. It will also allow braces to be used in the future
47to delimit parameters to metacharacters that currently take no parameters.
48
f9001595 49=head1 Performance Enhancements
05c8f9ed 50
f9001595 51=over 4
05c8f9ed
RS
52
53=item *
54
ef7131e9
Z
55Filetest ops manage the stack in a fractionally more efficient manner.
56
57=item *
58
59Globs used in a numeric context are now numerified directly in most cases,
60rather than being numerified via stringification.
61
2630d42b 62=back
95ce428c 63
f9001595 64=head1 Modules and Pragmata
c11980ad 65
f9001595 66=head2 Updated Modules and Pragmata
05c8f9ed 67
f9001595 68=over 4
75ff5956 69
2630d42b 70=item *
c11980ad 71
53de3ff0
FC
72L<B> has been upgraded from version 1.34 to 1.35.
73
74The C<stashlen> method of COPs has been added. This provides access to an
75internal field added in perl 5.16 under threaded builds [perl #113034].
76
77=item *
78
30608892
Z
79L<ExtUtils::ParseXS> has been upgraded from version 3.16 to 3.17.
80
81The generated C code now avoids unnecessarily incrementing
82C<PL_amagic_generation> on Perl versions where it's done automatically
83(or on current Perl where the variable no longer exists).
84
85=item *
86
ef7131e9
Z
87L<File::DosGlob> has been upgraded from version 1.06 to 1.07.
88
89Small documentation and comment fixes.
90
91=item *
92
93L<File::Find> has been upgraded from version 1.20 to 1.21.
94
95Individual files may now appear in list of directories to be searched
96[perl #59750].
97
98=item *
99
435b0bdb
FC
100L<File::stat> has been upgraded from version 1.05 to 1.06.
101
102C<File::stat> ignores the L<filetest> pragma, and warns when used in
103combination therewith. But it was not warning for C<-r>. This has been
104fixed [perl #111640].
105
be8dfbf7
FC
106C<-p> now works, and does not return false for pipes [perl #111638].
107
435b0bdb
FC
108=item *
109
110L<Hash::Util> has been upgraded from version 0.11 to 0.12.
83fb037c
FC
111
112C<hash_unlocked> and C<hashref_unlocked> now returns true if the hash is
113unlocked, instead of always returning false [perl #112126].
114
115C<hash_unlocked>, C<hashref_unlocked>, C<lock_hash_recurse> and
116C<unlock_hash_recurse> are now exportable [perl #112126].
117
118Two new functions, C<hash_locked> and C<hashref_locked>, have been added.
119Oddly enough, these two functions were already exported, even though they
120did not exist [perl #112126].
121
122=item *
123
f558db2f
Z
124L<Module::CoreList> has been upgraded from version 2.66 to 2.67.
125
126=item *
127
e3329bf0
FC
128L<overload> has been upgraded from version 1.18 to 1.19.
129
130C<no overload> now warns for invalid arguments, just like C<use overload>.
131
132=item *
133
80b8b050
Z
134L<Pod::Functions> has been upgraded from version 1.05 to 1.06.
135
136Typo fix in generated documentation.
137
138=item *
139
435b0bdb 140L<Storable> has been upgraded from version 2.34 to 2.35.
18d0dfa8
FC
141
142Modifying C<$_[0]> within C<STORABLE_freeze> no longer results in crashes
143[perl #112358].
843331c7 144
53de3ff0
FC
145An object whose class implements C<STORABLE_attach> is now thawed only once
146when there are multiple references to it in the structure being thawed
147[perl #111918].
148
30608892
Z
149=item *
150
151L<utf8> has been upgraded from version 1.09 to 1.10.
152
153Some documentation has been clarified.
154
2630d42b 155=back
c11980ad 156
f9001595 157=head2 Removed Modules and Pragmata
ecd144ea 158
f9001595 159=over 4
05c8f9ed
RS
160
161=item *
162
ae3c47e2
RS
163L<Version::Requirements> has been removed from the core distribution. It is
164available under a different name: L<CPAN::Meta::Requirements>.
9dea6244 165
204b72a4 166=back
9dea6244 167
f9001595 168=head1 Documentation
2a7afa74 169
f9001595 170=head2 Changes to Existing Documentation
39de7394 171
ef7131e9
Z
172=head3 L<perldata>
173
174=over 4
175
176=item *
177
178Now explicitly documents the behaviour of hash initializer lists that
179contain duplicate keys.
180
ef7131e9
Z
181=back
182
80b8b050
Z
183=head3 L<perldiag>
184
185=over 4
186
187=item *
188
189The explanation of symbolic references being prevented by "strict refs"
190now doesn't assume that the reader knows what symbolic references are.
191
80b8b050
Z
192=back
193
194=head3 L<perlfunc>
195
196=over 4
197
198=item *
199
200The return value of C<pipe> is now documented.
201
52deee2e 202=back
5dd80d85 203
f9001595 204=head1 Diagnostics
52272450 205
f9001595
RS
206The following additions or changes have been made to diagnostic output,
207including warnings and fatal error messages. For the complete list of
208diagnostic messages, see L<perldiag>.
249950d7 209
f9001595 210=head2 New Diagnostics
05c8f9ed 211
f9001595 212=head3 New Warnings
05c8f9ed 213
f9001595 214=over 4
05c8f9ed
RS
215
216=item *
d5dc7001 217
30608892
Z
218"L<Unescaped left brace in regex is deprecated, passed
219through|perldiag/"Unescaped left brace in regex is deprecated, passed
220through">" is a new deprecation warning. See L</Unescaped braces in
221regexps>.
222
f9001595 223=back
05c8f9ed 224
d78896a6 225=head1 Testing
05c8f9ed 226
f9001595 227=over 4
05c8f9ed
RS
228
229=item *
230
ef7131e9
Z
231The test suite now has a section for tests that require very large amounts
232of memory. These tests won't run by default; they can be enabled by
233setting the C<PERL_TEST_MEMORY> environment variable to the number of
234gibibytes of memory that may be safely used.
235
f9001595 236=back
05c8f9ed 237
f9001595 238=head1 Platform Support
05c8f9ed 239
d78896a6 240=head2 Platform-Specific Notes
05c8f9ed 241
f9001595 242=over 4
05c8f9ed 243
30608892
Z
244=item clang++
245
246There is now a workaround for a compiler bug that prevented compiling
247with clang++ since Perl 5.15.7 [perl #112786].
248
249=item C++
250
251When compiling the Perl core as C++ (which is only semi-supported), the
252mathom functions are now compiled as C<extern "C">, to ensure proper
253binary compatibility. (However, binary compatibility isn't generally
254guaranteed anyway in the situations where this would matter.)
255
256=item VMS
257
258It should now be possible to compile Perl as C++ on VMS.
259
f9001595 260=back
05c8f9ed 261
f9001595 262=head1 Internal Changes
05c8f9ed 263
f9001595 264=over 4
05c8f9ed
RS
265
266=item *
267
53de3ff0
FC
268The C<CV *> typemap entry now supports C<&{}> overloading and typeglobs,
269just like C<&{...}> [perl #96872].
270
271=item *
272
a3367fba
FC
273The C<SVf_AMAGIC> flag to indicate overloading is now on the stash, not the
274object. It is now set automatically whenever a method or @ISA changes, so
275its meaning has changed, too. It now means "potentially overloaded". When
276the overload table is calculated, the flag is automatically turned off if
277there is no overloading, so there should be no noticeable slowdown.
278
279The staleness of the overload tables is now checked when overload methods
280are invoked, rather than during C<bless>.
281
282"A" magic is gone. The changes to the handling of the C<SVf_AMAGIC> flag
283eliminate the need for it.
284
9976fb3d
FC
285C<PL_amagic_generation> has been removed as no longer necessary. For XS
286modules, it is now a macro alias to C<PL_na>.
a3367fba 287
909564a7
FC
288The fallback overload setting is now stored in a stash entry separate from
289overloadedness itself.
05c8f9ed 290
30608892
Z
291=item *
292
293The character-processing code has been cleaned up in places. The changes
294should be operationally invisible.
295
f9001595 296=back
05c8f9ed 297
f9001595 298=head1 Selected Bug Fixes
05c8f9ed 299
f9001595 300=over 4
05c8f9ed
RS
301
302=item *
303
cba2262a
FC
304C<goto ''> now looks for an empty label, producing the "goto must have
305label" error message, instead of exiting the program [perl #111794].
e2e06450 306
b9b99128
FC
307=item *
308
309C<goto "\0"> now dies with "Can't find label" instead of "goto must have
310label".
311
47fb883d
FC
312=item *
313
314The C function C<hv_store> used to result in crashes when used on C<%^H>
315[perl #111000].
316
5f0f4bc0
FC
317=item *
318
319A call checker attached to a closure prototype via C<cv_set_call_checker>
320is now copied to closures cloned from it. So C<cv_set_call_checker> now
321works inside an attribute handler for a closure.
322
ba0d99ee
FC
323=item *
324
325Writing to C<$^N> used to have no effect. Now it croaks with "Modification
326of a read-only value" by default, but that can be overridden by a custom
327regular expression engine, as with C<$1> [perl #112184].
328
72035cb1
FC
329=item *
330
331C<undef> on a control character glob (C<undef *^H>) no longer emits an
332erroneous warning about ambiguity [perl #112456].
333
ceb0881c
FC
334=item *
335
336For efficiency's sake, many operators and built-in functions return the
337same scalar each time. Lvalue subroutines and subroutines in the CORE::
338namespace were allowing this implementation detail to leak through.
339C<print &CORE::uc("a"), &CORE::uc("b")> used to print "BB". The same thing
340would happen with an lvalue subroutine returning the return value of C<uc>.
341Now the value is copied in such cases.
342
89cbc6b8
FC
343=item *
344
345C<method {}> syntax with an empty block or a block returning an empty list
346used to crash or use some random value left on the stack as its invocant.
347Now it produces an error.
348
c6b15a5a
FC
349=item *
350
d78896a6 351C<vec> now works with extremely large offsets (E<gt>2 GB) [perl #111730].
c6b15a5a 352
8e125188
FC
353=item *
354
355Changes to overload settings now take effect immediately, as do changes to
356inheritance that affect overloading. They used to take effect only after
357C<bless>.
358
359Objects that were created before a class had any overloading used to remain
360non-overloaded even if the class gained overloading through C<use overload>
361or @ISA changes, and even after C<bless>. This has been fixed
362[perl #112708].
363
c4643160
FC
364=item *
365
366Classes with overloading can now inherit fallback values.
367
422287bf
FC
368=item *
369
53de3ff0
FC
370Overloading was not respecting a fallback value of 0 if there were
371overloaded objects on both sides of an assignment operator like C<+=>
372[perl #111856].
373
374=item *
375
422287bf
FC
376C<pos> now croaks with hash and array arguments, instead of producing
377erroneous warnings.
378
2de6ba8d
FC
379=item *
380
381C<while(each %h)> now implies C<while(defined($_ = each %h))>, like
382C<readline> and C<readdir>.
383
52c4b146
FC
384=item *
385
386Subs in the CORE:: namespace no longer crash after C<undef *_> when called
387with no argument list (C<&CORE::time> with no parentheses).
388
9aa9a888
KW
389=item *
390
391Unicode 6.1 published an incorrect alias for one of the
392Canonical_Combining_Class property's values (which range between 0 and
393254). The alias C<CCC133> should have been C<CCC132>. Perl now
394overrides the data file furnished by Unicode to give the correct value.
395
53de3ff0
FC
396=item *
397
398C<unpack> no longer produces the "'/' must follow a numeric type in unpack"
399error when it is the data that are at fault [perl #60204].
400
401=item *
402
403C<join> and C<"@array"> now call FETCH only once on a tied C<$">
404[perl #8931].
405
80b8b050
Z
406=item *
407
408Some subroutine calls generated by compiling core ops affected by a
409C<CORE::GLOBAL> override had op checking performed twice. The checking
410is always idempotent for pure Perl code, but the double checking can
411matter when custom call checkers are involved.
412
eb3d0a58
LT
413=item *
414
415A race condition used to exist around fork that could cause a signal sent to
416the parent to be handled by both parent and child. Signals are now blocked
417briefly around fork to prevent this from happening [perl #82580].
418
2630d42b 419=back
e2e06450 420
d78896a6 421=head1 Acknowledgements
c0154fe2 422
d78896a6
Z
423Perl 5.17.0 represents approximately 1 week of development since Perl 5.16.0
424and contains approximately 17,000 lines of changes across 180 files from 26
425authors.
d5dc7001 426
d78896a6
Z
427Perl continues to flourish into its third decade thanks to a vibrant community
428of users and developers. The following people are known to have contributed the
429improvements that became Perl 5.16.1:
f9001595 430
d78896a6
Z
431Alan Haggai Alavi, Aristotle Pagaltzis, Brian Fraser, Chris 'BinGOs' Williams,
432Craig A. Berry, Dagfinn Ilmari Mannsåker, Eric Brine, Father Chrysostomos,
433Igor Zaytsev, James E Keenan, Karl Williamson, Leon Timmermans, Lukas Mai,
434Marcus Holland-Moritz, Matthew Horsfall, Moritz Lenz, Rafael Garcia-Suarez,
435Reini Urban, Ricardo Signes, Robin Barker, Ronald J. Kimball, Smylers, Steffen
436Müller, Steve Hay, Tony Cook, Zefram.
d5dc7001 437
d78896a6
Z
438The list above is almost certainly incomplete as it is automatically generated
439from version control history. In particular, it does not include the names of
440the (very much appreciated) contributors who reported issues to the Perl bug
441tracker.
d5dc7001 442
d78896a6
Z
443Many of the changes included in this version originated in the CPAN modules
444included in Perl's core. We're grateful to the entire CPAN community for
445helping Perl to flourish.
f9001595 446
d78896a6
Z
447For a more complete list of all of Perl's historical contributors, please see
448the F<AUTHORS> file in the Perl source distribution.
29cf780c 449
44691e6f
AB
450=head1 Reporting Bugs
451
452If you find what you think is a bug, you might check the articles
52deee2e 453recently posted to the comp.lang.perl.misc newsgroup and the perl
f9001595
RS
454bug database at http://rt.perl.org/perlbug/ . There may also be
455information at http://www.perl.org/ , the Perl Home Page.
44691e6f
AB
456
457If you believe you have an unreported bug, please run the L<perlbug>
52deee2e
DR
458program included with your release. Be sure to trim your bug down
459to a tiny but sufficient test case. Your bug report, along with the
460output of C<perl -V>, will be sent off to perlbug@perl.org to be
461analysed by the Perl porting team.
44691e6f
AB
462
463If the bug you are reporting has security implications, which make it
f9001595
RS
464inappropriate to send to a publicly archived mailing list, then please send
465it to perl5-security-report@perl.org. This points to a closed subscription
466unarchived mailing list, which includes
467all the core committers, who will be able
468to help assess the impact of issues, figure out a resolution, and help
469co-ordinate the release of patches to mitigate or fix the problem across all
470platforms on which Perl is supported. Please only use this address for
471security issues in the Perl core, not for modules independently
472distributed on CPAN.
44691e6f
AB
473
474=head1 SEE ALSO
475
52deee2e
DR
476The F<Changes> file for an explanation of how to view exhaustive details
477on what changed.
44691e6f
AB
478
479The F<INSTALL> file for how to build Perl.
480
481The F<README> file for general stuff.
482
483The F<Artistic> and F<Copying> files for copyright information.
484
485=cut