Commit | Line | Data |
---|---|---|
44691e6f AB |
1 | =encoding utf8 |
2 | ||
3 | =head1 NAME | |
4 | ||
3432e5a1 | 5 | perldelta - what is new for perl v5.15.4 |
760696b8 | 6 | |
5438d4b8 | 7 | =head1 DESCRIPTION |
5cd408a2 | 8 | |
3432e5a1 SL |
9 | This document describes differences between the 5.15.3 release and |
10 | the 5.15.4 release. | |
5cd408a2 | 11 | |
3432e5a1 SL |
12 | If you are upgrading from an earlier release such as 5.15.3, first read |
13 | L<perl5153delta>, which describes differences between 5.15.3 and | |
14 | 5.15.4. | |
062678b2 | 15 | |
63ac71b9 | 16 | =head1 Core Enhancements |
0afed34d | 17 | |
3f728e2e | 18 | =head2 $^X converted to an absolute path on FreeBSD, OS X and Solaris |
d2006265 | 19 | |
3f728e2e NC |
20 | C<$^X> is now converted to an absolute path on OS X, FreeBSD (without |
21 | needing F</proc> mounted) and Solaris 10 and 11. This augments the | |
22 | previous approach of using F</proc> on Linux, FreeBSD and NetBSD | |
23 | (in all cases, where mounted). | |
24 | ||
25 | This makes relocatable perl installations more useful on these platforms. | |
26 | (See "Relocatable @INC" in F<INSTALL>) | |
d6cf2367 | 27 | |
6d110ad0 FC |
28 | =head2 Unicode Symbol Names |
29 | ||
30 | Perl now has proper support for Unicode in symbol names. It used to be | |
31 | that C<*{$foo}> would ignore the internal UTF8 flag and use the bytes of | |
32 | the underlying representation to look up the symbol. That meant that | |
33 | C<*{"\x{100}"}> and C<*{"\xc4\x80"}> would return the same thing. All | |
34 | these parts of Perl have been fixed to account for Unicode: | |
35 | ||
36 | =over | |
37 | ||
38 | =item * | |
39 | ||
40 | Method names (including those passed to C<use overload>) | |
41 | ||
42 | =item * | |
43 | ||
44 | Typeglob names (including names of variables, subroutines and filehandles) | |
45 | ||
46 | =item * | |
47 | ||
48 | Package names | |
49 | ||
50 | =item * | |
51 | ||
b2ef4871 | 52 | Constant subroutine names (not null-clean yet) |
6d110ad0 FC |
53 | |
54 | =item * | |
55 | ||
56 | C<goto> | |
57 | ||
58 | =item * | |
59 | ||
60 | Symbolic dereferencing | |
61 | ||
62 | =item * | |
63 | ||
64 | Second argument to C<bless()> and C<tie()> | |
65 | ||
66 | =item * | |
67 | ||
68 | Return value of C<ref()> | |
69 | ||
70 | =item * | |
71 | ||
72 | Package names returned by C<caller()> | |
73 | ||
74 | =item * | |
75 | ||
76 | Subroutine prototypes | |
77 | ||
78 | =item * | |
79 | ||
80 | Attributes | |
81 | ||
82 | =item * | |
83 | ||
84 | Various warnings and error messages that mention variable names or values, | |
85 | methods, etc. | |
86 | ||
87 | =back | |
88 | ||
89 | In addition, a parsing bug has been fixed that prevented C<*{é}> from | |
90 | implicitly quoting the name, but instead interpreted it as C<*{+é}>, which | |
91 | would cause a strict violation. | |
92 | ||
93 | C<*{"*a::b"}> automatically strips off the * if it is followed by an ASCII | |
94 | letter. That has been extended to all Unicode identifier characters. | |
95 | ||
96 | C<$é> is now subject to "Used only once" warnings. It used to be exempt, | |
97 | as it was treated as a punctuation variable. | |
98 | ||
b53e16ae FC |
99 | Also, single-character Unicode punctuation variables (like $‰) are now |
100 | supported [perl #69032]. They are also supported with C<our> and C<my>, | |
101 | but that is a mistake that will be fixed before 5.16. | |
102 | ||
b2ef4871 | 103 | =head2 Support for Embedded Nulls |
6d110ad0 | 104 | |
b2ef4871 | 105 | Some parts of Perl did not work correctly with nulls (C<chr 0>) embedded in |
6d110ad0 FC |
106 | strings. That meant that, for instance, C<< $m = "a\0b"; foo->$m >> would |
107 | call the "a" method, instead of the actual method name contained in $m. | |
b2ef4871 | 108 | These parts of perl have been fixed to support nulls: |
6d110ad0 FC |
109 | |
110 | =over | |
111 | ||
112 | =item * | |
113 | ||
114 | Method names | |
115 | ||
116 | =item * | |
117 | ||
118 | Typeglob names (including filehandle names) | |
119 | ||
120 | =item * | |
121 | ||
122 | Package names | |
123 | ||
124 | =item * | |
125 | ||
126 | Autoloading | |
127 | ||
128 | =item * | |
129 | ||
130 | Return value of C<ref()> | |
131 | ||
132 | =item * | |
133 | ||
134 | Package names returned by C<caller()> | |
135 | ||
136 | =item * | |
137 | ||
138 | Filehandle warnings | |
139 | ||
140 | =item * | |
141 | ||
142 | Typeglob elements (C<*foo{"THING\0stuff"}>) | |
143 | ||
144 | =item * | |
145 | ||
146 | Signal names | |
147 | ||
148 | =item * | |
149 | ||
150 | Various warnings and error messages that mention variable names or values, | |
151 | methods, etc. | |
152 | ||
153 | =back | |
154 | ||
155 | One side effect of these changes is that blessing into "\0" no longer | |
156 | causes C<ref()> to return false. | |
157 | ||
46dd4080 | 158 | =head2 Autoloaded sort Subroutines |
b53e16ae FC |
159 | |
160 | Custom sort subroutines can now be autoloaded [perl #30661]: | |
161 | ||
162 | sub AUTOLOAD { ... } | |
163 | @sorted = sort foo @list; # uses AUTOLOAD | |
164 | ||
46dd4080 S |
165 | =head2 Improved typemaps for Some Builtin Types |
166 | ||
167 | Most XS authors will be aware that there is a longstanding bug | |
168 | in the OUTPUT typemap for T_AVREF (C<AV*>), T_HVREF (C<HV*>), | |
169 | T_CVREF (C<CV*>), and T_SVREF (C<SVREF> or C<\$foo>) that requires | |
170 | manually decrementing the reference count of the return value | |
171 | instead of the typemap taking care of this. For | |
172 | backwards-compatibility, this cannot be changed in the default | |
173 | typemaps. But we now provide additional typemaps | |
174 | C<T_AVREF_REFCOUNT_FIXED>, etc. that do not exhibit this bug. | |
175 | Using them in your extension is as simple as having one line | |
176 | in your C<TYPEMAP> section: | |
177 | ||
178 | HV* T_HVREF_REFCOUNT_FIXED | |
179 | ||
3432e5a1 | 180 | =head1 Performance Enhancements |
d6cf2367 | 181 | |
63ac71b9 | 182 | =over 4 |
e46d9735 CBW |
183 | |
184 | =item * | |
185 | ||
b53e16ae FC |
186 | C<substr> no longer calculates a value to return when called in void |
187 | context. | |
828d6195 | 188 | |
3432e5a1 | 189 | =back |
83307084 | 190 | |
3432e5a1 | 191 | =head1 Modules and Pragmata |
83307084 | 192 | |
3432e5a1 | 193 | =head2 Updated Modules and Pragmata |
d39de893 | 194 | |
3432e5a1 | 195 | =over 4 |
39afdc5a CBW |
196 | |
197 | =item * | |
198 | ||
1e915955 | 199 | L<Archive::Tar> has been upgraded from version 1.78 to version 1.80. |
666c7ca6 | 200 | |
7b8e5ef0 GG |
201 | =item * |
202 | ||
91710846 DG |
203 | L<base> has been upgraded from version 2.17 to version 2.18. |
204 | ||
205 | C<base> no longer sets a module's C<$VERSION> to "-1" when a module it loads | |
206 | does not define a C<$VERSION>. This change has been made because "-1" is not | |
207 | a valid version number under the new "lax" criteria used internally by | |
f4baccf2 | 208 | C<UNIVERSAL::VERSION>. (See L<version> for more on "lax" version criteria.) |
91710846 DG |
209 | |
210 | C<base> no longer internally skips loading modules it has already loaded and | |
211 | instead relies on C<require> to inspect C<%INC>. This fixes a bug when C<base> | |
212 | is used with code that clear C<%INC> to force a module to be reloaded. | |
213 | ||
214 | =item * | |
215 | ||
a2fa999d CBW |
216 | L<Digest> has been upgraded from version 1.16 to version 1.17. |
217 | ||
218 | =item * | |
219 | ||
19e72bbf FC |
220 | L<DynaLoader> has been upgraded from version 1.13 to 1.14. |
221 | ||
222 | It stopped exporting its symbols with the ExtUtils::ParseXS changes in | |
1e915955 | 223 | 5.15.2. Now it exports them once more. |
19e72bbf FC |
224 | |
225 | =item * | |
226 | ||
7b8e5ef0 GG |
227 | L<ExtUtils::MakeMaker> has been upgraded from version 6.59 to version 6.61_01. |
228 | ||
bd65daab CBW |
229 | =item * |
230 | ||
02e7ec6d | 231 | L<ExtUtils::ParseXS> has been upgraded from version 3.04_04 to version 3.05. |
bd65daab | 232 | |
3f2cb5bf S |
233 | =item * |
234 | ||
f0381222 FR |
235 | L<Module::CoreList> has been upgraded from version 2.56 to 2.57. |
236 | ||
237 | =item * | |
238 | ||
02e7ec6d CBW |
239 | L<Module::Load> has been upgraded from version 0.20 to version 0.22. |
240 | ||
241 | Resolve possible security problem [http://goo.gl/YzHRU] where a '::' prefixed | |
242 | module can 'jump' out of @INC | |
243 | ||
244 | =item * | |
245 | ||
1e915955 CBW |
246 | L<perlfaq> has been upgraded from version 5.0150034 to version 5.0150035. |
247 | ||
248 | =item * | |
249 | ||
b2ef759e CBW |
250 | L<Unicode::Collate> has been upgraded from version 0.78 to version 0.80. |
251 | ||
252 | Locales updated to CLDR 2.0: ar, be, bg, ha, hr, kk, lt. | |
253 | Newly supported locales: as, fi__phonebook, gu, hi, kn, kok and ln. | |
3f2cb5bf | 254 | |
3432e5a1 | 255 | =back |
666c7ca6 | 256 | |
3432e5a1 | 257 | =head1 Documentation |
8fe353ef | 258 | |
3432e5a1 | 259 | =head2 Changes to Existing Documentation |
7ac26854 | 260 | |
19e72bbf | 261 | =head3 L<perlfunc>, L<open> |
daef35db | 262 | |
3432e5a1 | 263 | =over 4 |
83307084 SL |
264 | |
265 | =item * | |
266 | ||
19e72bbf FC |
267 | As an accident of history, C<open $fh, "<:", ...> applies the default |
268 | layers for the platform (C<:raw> on Unix, C<:crlf> on Windows), ignoring | |
269 | whatever is declared by L<open.pm|open>. This seems such a useful feature | |
270 | it has been documented in L<perlfunc|perlfunc/open> and L<open>. | |
b420b12a | 271 | |
3432e5a1 | 272 | =back |
b420b12a | 273 | |
b53e16ae FC |
274 | =head3 L<perlapi> |
275 | ||
276 | =over 4 | |
277 | ||
278 | =item * | |
279 | ||
280 | The HV API has long accepted negative lengths to indicate that the key is | |
281 | in UTF8. Now this is documented. | |
282 | ||
9eb1e3e2 FR |
283 | =item * |
284 | ||
285 | The C<boolSV()> macro is now documented. | |
286 | ||
b53e16ae FC |
287 | =back |
288 | ||
289 | =head3 L<perlguts> | |
290 | ||
291 | =over 4 | |
292 | ||
293 | =item * | |
294 | ||
295 | A new section, L<Autoloading with XSUBs|perlguts/Autoloading with XSUBs>, | |
296 | has been added, which explains the two APIs for accessing the name of the | |
297 | autoloaded sub. | |
298 | ||
299 | =back | |
300 | ||
3432e5a1 | 301 | =head1 Diagnostics |
83307084 | 302 | |
3432e5a1 SL |
303 | The following additions or changes have been made to diagnostic output, |
304 | including warnings and fatal error messages. For the complete list of | |
305 | diagnostic messages, see L<perldiag>. | |
83307084 | 306 | |
3432e5a1 SL |
307 | =head2 Changes to Existing Diagnostics |
308 | ||
d6cf2367 FC |
309 | =over 4 |
310 | ||
311 | =item * | |
312 | ||
c634fdd3 KW |
313 | The message, |
314 | "Code point 0x%X is not Unicode, no properties match it; all inverse | |
315 | prop erties do" has been changed to "Code point 0x%X is not Unicode, all | |
316 | \p{} matches fail; all \P{} matches succeed" | |
317 | ||
3432e5a1 | 318 | =back |
9cfd094e | 319 | |
3432e5a1 | 320 | =head1 Testing |
9cfd094e | 321 | |
3432e5a1 | 322 | =over 4 |
95f7e41f | 323 | |
83307084 | 324 | =item * |
95f7e41f | 325 | |
6692294e NC |
326 | F<t/porting/checkcfgvar.t> now tests that all config.sh-style files are |
327 | complete. These are used by the various non-*nix to generate their | |
328 | F<config.h>, and an incomplete input file will generate invalid output. | |
df5b44bd | 329 | |
63ac71b9 | 330 | =back |
310913d4 | 331 | |
3432e5a1 | 332 | =head1 Internal Changes |
d6cf2367 | 333 | |
3432e5a1 | 334 | =over 4 |
5d4ff231 | 335 | |
a3342be3 FC |
336 | =item * |
337 | ||
6d110ad0 FC |
338 | These new functions have been added as part of the work on Unicode symbols: |
339 | ||
340 | HvNAMELEN | |
341 | HvNAMEUTF8 | |
342 | HvENAMELEN | |
343 | HvENAMEUTF8 | |
344 | gv_init_pv | |
345 | gv_init_pvn | |
346 | gv_init_pvsv | |
347 | gv_fetchmeth_pv | |
348 | gv_fetchmeth_pvn | |
349 | gv_fetchmeth_sv | |
350 | gv_fetchmeth_pv_autoload | |
351 | gv_fetchmeth_pvn_autoload | |
352 | gv_fetchmeth_sv_autoload | |
353 | gv_fetchmethod_pv_flags | |
354 | gv_fetchmethod_pvn_flags | |
355 | gv_fetchmethod_sv_flags | |
356 | gv_autoload_pv | |
357 | gv_autoload_pvn | |
358 | gv_autoload_sv | |
359 | newGVgen_flags | |
360 | sv_derived_from_pv | |
361 | sv_derived_from_pvn | |
362 | sv_derived_from_sv | |
363 | sv_does_pv | |
364 | sv_does_pvn | |
365 | sv_does_sv | |
366 | whichsig_pv | |
367 | whichsig_pvn | |
368 | whichsig_sv | |
369 | ||
370 | The gv_fetchmethod_*_flags functions, like gv_fetchmethod_flags, are | |
371 | experimental and may change in a future release. | |
372 | ||
373 | =item * | |
374 | ||
375 | The following functions were added. These are I<not> part of the API: | |
376 | ||
377 | GvNAMEUTF8 | |
378 | GvENAMELEN | |
379 | GvENAME_HEK | |
380 | CopSTASH_flags | |
381 | CopSTASH_flags_set | |
382 | PmopSTASH_flags | |
383 | PmopSTASH_flags_set | |
384 | sv_sethek | |
b53e16ae FC |
385 | HEKfARG |
386 | ||
387 | There is also a C<HEKf> macro corresponding to C<SVf>, for | |
388 | interpolating HEKs in formatted strings. | |
6d110ad0 FC |
389 | |
390 | =item * | |
391 | ||
392 | C<sv_catpvn_flags> takes a couple of new internal-only flags, | |
393 | C<SV_CATBYTES> and C<SV_CATUTF8>, which tell it whether the char array to | |
394 | be concatenated is UTF8. This allows for more efficient concatenation than | |
395 | creating temporary SVs to pass to C<sv_catsv>. | |
60092ce4 | 396 | |
b53e16ae FC |
397 | =item * |
398 | ||
399 | For XS AUTOLOAD subs, $AUTOLOAD is set once more, as it was in 5.6.0. This | |
400 | is in addition to setting C<SvPVX(cv)>, for compatibility with 5.8 to 5.14. | |
401 | See L<perlguts/Autoloading with XSUBs>. | |
402 | ||
403 | =item * | |
404 | ||
405 | Perl now checks whether the array (the linearised isa) returned by a MRO | |
406 | plugin begins with the name of the class itself, for which the array was | |
407 | created, instead of assuming that it does. This prevents the first element | |
408 | from being skipped during method lookup. It also means that | |
409 | C<mro::get_linear_isa> may return an array with one more element than the | |
410 | MRO plugin provided [perl #94306]. | |
411 | ||
3432e5a1 | 412 | =back |
60092ce4 | 413 | |
3432e5a1 | 414 | =head1 Selected Bug Fixes |
309aab3a | 415 | |
3432e5a1 | 416 | =over 4 |
1f26655e | 417 | |
433644ee FC |
418 | =item * |
419 | ||
19e72bbf FC |
420 | In Perl 5.14.0, C<$tainted ~~ @array> stopped working properly. Sometimes |
421 | it would erroneously fail (when C<$tainted> contained a string that occurs | |
422 | in the array I<after> the first element) or erroneously succeed (when | |
423 | C<undef> occurred after the first element) [perl #93590]. | |
424 | ||
425 | =item * | |
426 | ||
427 | Perl 5.15.0 introduced a minor regression, in that an object referenced by | |
428 | a deleted hash element would be able to access the freed element from its | |
429 | DESTROY method, causing panic errors [perl #99660]. | |
430 | ||
431 | =item * | |
432 | ||
433 | Functions in the CORE package can now be called as methods. That used to | |
434 | work only when they had been called or referenced already. So | |
435 | C<< "foo"->CORE::ucfirst >> returns Foo. | |
436 | ||
437 | =item * | |
438 | ||
439 | C<use> and C<require> are no longer affected by the I/O layers active in | |
440 | the caller's scope (enabled by L<open.pm|open>) [perl #96008]. | |
441 | ||
442 | =item * | |
443 | ||
444 | Errors that occur when methods cannot be found during overloading now | |
445 | mention the correct package name, as they did in 5.8.x, instead of | |
446 | erroneously mentioning the "overload" package, as they have since 5.10.0. | |
447 | ||
448 | =item * | |
449 | ||
450 | Undefining C<%overload::> no longer causes a crash. | |
433644ee | 451 | |
6d110ad0 FC |
452 | =item * |
453 | ||
454 | C<our $::é; $é> (which is invalid) no longer produces the "Compilation | |
455 | error at lib/utf8_heavy.pl..." error message, which it started emitting in | |
456 | 5.10.0 [perl #99984]. | |
457 | ||
b377a702 KW |
458 | =item * |
459 | ||
460 | A minor regression, introduced Perl 5.15.0, has been fixed in which some | |
461 | regular expression Unicode property matches (C<\p{...}>) matched | |
462 | non-Unicode code points. | |
463 | ||
7c1b9f38 KW |
464 | =item * |
465 | ||
466 | In case-insensitive regular expression pattern matching, no longer on | |
467 | UTF-8 encoded strings does the scan for the start of match only look at | |
468 | the first possible position. This caused matches such as | |
469 | C<"f\x{FB00}" =~ /ff/i> to fail. | |
470 | ||
b53e16ae FC |
471 | =item * |
472 | ||
473 | On 64-bit systems, C<read()> now understands large string offsets beyond | |
474 | the 32-bit range. | |
475 | ||
476 | =item * | |
477 | ||
478 | Errors that occur when processing subroutine attributes no longer cause the | |
479 | subroutine's op tree to leak. | |
480 | ||
481 | =item * | |
482 | ||
483 | C<sort> now works once more with custom sort routines that are XSUBs. It | |
484 | stopped working in 5.10.0. | |
485 | ||
486 | =item * | |
487 | ||
ca955add FC |
488 | C<sort> with a constant for a custom sort routine, although it produces |
489 | unsorted results, no longer crashes. It started crashing in 5.10.0. | |
490 | ||
491 | =item * | |
492 | ||
b53e16ae FC |
493 | Warnings produced when a custom sort routine returns a non-numeric value |
494 | now contain "in sort"; e.g., "Use of uninitialized value in sort". | |
495 | ||
496 | =item * | |
497 | ||
498 | C<< sort { $a <=> $b } >>, which is optimised internally, now produces | |
499 | "uninitialized" warnings for NaNs (not-a-number values), since C<< <=> >> | |
500 | returns C<undef> for those. This brings it in line with | |
501 | S<C<< sort { 1; $a <=> $b } >>> and other more complex cases, which are not | |
502 | optimised [perl #94390]. | |
503 | ||
504 | =item * | |
505 | ||
506 | C<..> and C<...> in list context now call FETCH only once on tied | |
507 | arguments, instead of three or four times [perl #53554]. | |
508 | ||
509 | =item * | |
510 | ||
511 | C<..> and C<...> in list context now mention the name of the variable in | |
512 | "uninitialized" warnings for string (as opposed to numeric) ranges. | |
513 | ||
63ac71b9 | 514 | =back |
bbc28bfc | 515 | |
44691e6f AB |
516 | =head1 Acknowledgements |
517 | ||
3432e5a1 SL |
518 | XXX Generate this with: |
519 | ||
520 | perl Porting/acknowledgements.pl v5.15.3..HEAD | |
29cf780c | 521 | |
44691e6f AB |
522 | =head1 Reporting Bugs |
523 | ||
524 | If you find what you think is a bug, you might check the articles | |
34dc2ec0 | 525 | recently posted to the comp.lang.perl.misc newsgroup and the perl |
44691e6f AB |
526 | bug database at http://rt.perl.org/perlbug/ . There may also be |
527 | information at http://www.perl.org/ , the Perl Home Page. | |
528 | ||
529 | If you believe you have an unreported bug, please run the L<perlbug> | |
530 | program included with your release. Be sure to trim your bug down | |
531 | to a tiny but sufficient test case. Your bug report, along with the | |
532 | output of C<perl -V>, will be sent off to perlbug@perl.org to be | |
533 | analysed by the Perl porting team. | |
534 | ||
535 | If the bug you are reporting has security implications, which make it | |
536 | inappropriate to send to a publicly archived mailing list, then please send | |
34dc2ec0 | 537 | it to perl5-security-report@perl.org. This points to a closed subscription |
b4707b2a FC |
538 | unarchived mailing list, which includes |
539 | all the core committers, who will be able | |
44691e6f AB |
540 | to help assess the impact of issues, figure out a resolution, and help |
541 | co-ordinate the release of patches to mitigate or fix the problem across all | |
34dc2ec0 DM |
542 | platforms on which Perl is supported. Please only use this address for |
543 | security issues in the Perl core, not for modules independently | |
44691e6f AB |
544 | distributed on CPAN. |
545 | ||
546 | =head1 SEE ALSO | |
547 | ||
548 | The F<Changes> file for an explanation of how to view exhaustive details | |
549 | on what changed. | |
550 | ||
551 | The F<INSTALL> file for how to build Perl. | |
552 | ||
553 | The F<README> file for general stuff. | |
554 | ||
555 | The F<Artistic> and F<Copying> files for copyright information. | |
556 | ||
557 | =cut |