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