This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
typo in perlre.pod
[perl5.git] / pod / perl5154delta.pod
1 =encoding utf8
2
3 =head1 NAME
4
5 perl5154delta - what is new for perl v5.15.4
6
7 =head1 DESCRIPTION
8
9 This document describes differences between the 5.15.3 release and
10 the 5.15.4 release.
11
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.
15
16 =head1 Core Enhancements
17
18 =head2 $^X converted to an absolute path on FreeBSD, OS X and Solaris
19
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>)
27
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
52 Constant subroutine names (not null-clean yet)
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
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
103 =head2 Support for Embedded Nulls
104
105 Some parts of Perl did not work correctly with nulls (C<chr 0>) embedded in
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.
108 These parts of perl have been fixed to support nulls:
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
158 =head2 Autoloaded sort Subroutines
159
160 Custom sort subroutines can now be autoloaded [perl #30661]:
161
162     sub AUTOLOAD { ... }
163     @sorted = sort foo @list; # uses AUTOLOAD
164
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
180 =head1 Performance Enhancements
181
182 =over 4
183
184 =item *
185
186 C<substr> no longer calculates a value to return when called in void
187 context.
188
189 =back
190
191 =head1 Modules and Pragmata
192
193 =head2 Updated Modules and Pragmata
194
195 =over 4
196
197 =item *
198
199 L<Archive::Tar> has been upgraded from version 1.78 to version 1.80.
200
201 =item *
202
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
208 C<UNIVERSAL::VERSION>.  (See L<version> for more on "lax" version criteria.)
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
216 L<Digest> has been upgraded from version 1.16 to version 1.17.
217
218 =item *
219
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
223 5.15.2.  Now it exports them once more.
224
225 =item *
226
227 L<ExtUtils::MakeMaker> has been upgraded from version 6.59 to version 6.61_01.
228
229 =item *
230
231 L<ExtUtils::ParseXS> has been upgraded from version 3.04_04 to version 3.05.
232
233 =item *
234
235 L<Module::CoreList> has been upgraded from version 2.56 to 2.57.
236
237 =item *
238
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
246 L<perlfaq> has been upgraded from version 5.0150034 to version 5.0150035.
247
248 =item *
249
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.
254
255 =back
256
257 =head1 Documentation
258
259 =head2 Changes to Existing Documentation
260
261 =head3 L<perlfunc>, L<open>
262
263 =over 4
264
265 =item *
266
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>.
271
272 =back
273
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
283 =item *
284
285 The C<boolSV()> macro is now documented.
286
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
301 =head1 Diagnostics
302
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>.
306
307 =head2 Changes to Existing Diagnostics
308
309 =over 4
310
311 =item *
312
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
318 =back
319
320 =head1 Testing
321
322 =over 4
323
324 =item *
325
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.
329
330 =back
331
332 =head1 Internal Changes
333
334 =over 4
335
336 =item *
337
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
385     HEKfARG
386
387 There is also a C<HEKf> macro corresponding to C<SVf>, for
388 interpolating HEKs in formatted strings.
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>.
396
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
412 =back
413
414 =head1 Selected Bug Fixes
415
416 =over 4
417
418 =item *
419
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.
451
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
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
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
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
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
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
514 =back
515
516 =head1 Acknowledgements
517
518 Perl 5.15.4 represents approximately 1 month of development since Perl 5.15.3
519 and contains approximately 31,000 lines of changes across 350 files from 23
520 authors.
521
522 Perl continues to flourish into its third decade thanks to a vibrant community
523 of users and developers. The following people are known to have contributed the
524 improvements that became Perl 5.15.4:
525
526 Alan Haggai Alavi, Brian Fraser, Chip Salzenberg, Chris 'BinGOs' Williams, Dave
527 Rolsky, David Golden, David Mitchell, Dennis Kaarsemaker, Eric Brine, Father
528 Chrysostomos, Florian Ragwitz, George Greer, Gerard Goossen, H.Merijn Brand,
529 Jim Cromie, John P. Linderman, Karl Williamson, Nicholas Clark, Reini Urban,
530 Steffen Müller, Stevan Little, Thorsten Glaser, Tony Cook.
531
532 The list above is almost certainly incomplete as it is automatically generated
533 from version control history. In particular, it does not include the names of
534 the (very much appreciated) contributors who reported issues to the Perl bug
535 tracker.
536
537 Many of the changes included in this version originated in the CPAN modules
538 included in Perl's core. We're grateful to the entire CPAN community for
539 helping Perl to flourish.
540
541 For a more complete list of all of Perl's historical contributors, please see
542 the F<AUTHORS> file in the Perl source distribution.
543
544 =head1 Reporting Bugs
545
546 If you find what you think is a bug, you might check the articles
547 recently posted to the comp.lang.perl.misc newsgroup and the perl
548 bug database at http://rt.perl.org/perlbug/ .  There may also be
549 information at http://www.perl.org/ , the Perl Home Page.
550
551 If you believe you have an unreported bug, please run the L<perlbug>
552 program included with your release.  Be sure to trim your bug down
553 to a tiny but sufficient test case.  Your bug report, along with the
554 output of C<perl -V>, will be sent off to perlbug@perl.org to be
555 analysed by the Perl porting team.
556
557 If the bug you are reporting has security implications, which make it
558 inappropriate to send to a publicly archived mailing list, then please send
559 it to perl5-security-report@perl.org. This points to a closed subscription
560 unarchived mailing list, which includes
561 all the core committers, who will be able
562 to help assess the impact of issues, figure out a resolution, and help
563 co-ordinate the release of patches to mitigate or fix the problem across all
564 platforms on which Perl is supported. Please only use this address for
565 security issues in the Perl core, not for modules independently
566 distributed on CPAN.
567
568 =head1 SEE ALSO
569
570 The F<Changes> file for an explanation of how to view exhaustive details
571 on what changed.
572
573 The F<INSTALL> file for how to build Perl.
574
575 The F<README> file for general stuff.
576
577 The F<Artistic> and F<Copying> files for copyright information.
578
579 =cut