This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add the 5.15.4 epigraph
[perl5.git] / pod / perldelta.pod
CommitLineData
44691e6f
AB
1=encoding utf8
2
3=head1 NAME
4
3432e5a1 5perldelta - what is new for perl v5.15.4
760696b8 6
5438d4b8 7=head1 DESCRIPTION
5cd408a2 8
3432e5a1
SL
9This document describes differences between the 5.15.3 release and
10the 5.15.4 release.
5cd408a2 11
3432e5a1
SL
12If you are upgrading from an earlier release such as 5.15.3, first read
13L<perl5153delta>, which describes differences between 5.15.3 and
145.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
20C<$^X> is now converted to an absolute path on OS X, FreeBSD (without
21needing F</proc> mounted) and Solaris 10 and 11. This augments the
22previous approach of using F</proc> on Linux, FreeBSD and NetBSD
23(in all cases, where mounted).
24
25This 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
30Perl now has proper support for Unicode in symbol names. It used to be
31that C<*{$foo}> would ignore the internal UTF8 flag and use the bytes of
32the underlying representation to look up the symbol. That meant that
33C<*{"\x{100}"}> and C<*{"\xc4\x80"}> would return the same thing. All
34these parts of Perl have been fixed to account for Unicode:
35
36=over
37
38=item *
39
40Method names (including those passed to C<use overload>)
41
42=item *
43
44Typeglob names (including names of variables, subroutines and filehandles)
45
46=item *
47
48Package names
49
50=item *
51
b2ef4871 52Constant subroutine names (not null-clean yet)
6d110ad0
FC
53
54=item *
55
56C<goto>
57
58=item *
59
60Symbolic dereferencing
61
62=item *
63
64Second argument to C<bless()> and C<tie()>
65
66=item *
67
68Return value of C<ref()>
69
70=item *
71
72Package names returned by C<caller()>
73
74=item *
75
76Subroutine prototypes
77
78=item *
79
80Attributes
81
82=item *
83
84Various warnings and error messages that mention variable names or values,
85methods, etc.
86
87=back
88
89In addition, a parsing bug has been fixed that prevented C<*{é}> from
90implicitly quoting the name, but instead interpreted it as C<*{+é}>, which
91would cause a strict violation.
92
93C<*{"*a::b"}> automatically strips off the * if it is followed by an ASCII
94letter. That has been extended to all Unicode identifier characters.
95
96C<$é> is now subject to "Used only once" warnings. It used to be exempt,
97as it was treated as a punctuation variable.
98
b53e16ae
FC
99Also, single-character Unicode punctuation variables (like $‰) are now
100supported [perl #69032]. They are also supported with C<our> and C<my>,
101but that is a mistake that will be fixed before 5.16.
102
b2ef4871 103=head2 Support for Embedded Nulls
6d110ad0 104
b2ef4871 105Some parts of Perl did not work correctly with nulls (C<chr 0>) embedded in
6d110ad0
FC
106strings. That meant that, for instance, C<< $m = "a\0b"; foo->$m >> would
107call the "a" method, instead of the actual method name contained in $m.
b2ef4871 108These parts of perl have been fixed to support nulls:
6d110ad0
FC
109
110=over
111
112=item *
113
114Method names
115
116=item *
117
118Typeglob names (including filehandle names)
119
120=item *
121
122Package names
123
124=item *
125
126Autoloading
127
128=item *
129
130Return value of C<ref()>
131
132=item *
133
134Package names returned by C<caller()>
135
136=item *
137
138Filehandle warnings
139
140=item *
141
142Typeglob elements (C<*foo{"THING\0stuff"}>)
143
144=item *
145
146Signal names
147
148=item *
149
150Various warnings and error messages that mention variable names or values,
151methods, etc.
152
153=back
154
155One side effect of these changes is that blessing into "\0" no longer
156causes C<ref()> to return false.
157
46dd4080 158=head2 Autoloaded sort Subroutines
b53e16ae
FC
159
160Custom sort subroutines can now be autoloaded [perl #30661]:
161
162 sub AUTOLOAD { ... }
163 @sorted = sort foo @list; # uses AUTOLOAD
164
46dd4080
SM
165=head2 Improved typemaps for Some Builtin Types
166
167Most XS authors will be aware that there is a longstanding bug
168in the OUTPUT typemap for T_AVREF (C<AV*>), T_HVREF (C<HV*>),
169T_CVREF (C<CV*>), and T_SVREF (C<SVREF> or C<\$foo>) that requires
170manually decrementing the reference count of the return value
171instead of the typemap taking care of this. For
172backwards-compatibility, this cannot be changed in the default
173typemaps. But we now provide additional typemaps
174C<T_AVREF_REFCOUNT_FIXED>, etc. that do not exhibit this bug.
175Using them in your extension is as simple as having one line
176in 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
186C<substr> no longer calculates a value to return when called in void
187context.
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 199L<Archive::Tar> has been upgraded from version 1.78 to version 1.80.
666c7ca6 200
7b8e5ef0
GG
201=item *
202
91710846
DG
203L<base> has been upgraded from version 2.17 to version 2.18.
204
205C<base> no longer sets a module's C<$VERSION> to "-1" when a module it loads
206does not define a C<$VERSION>. This change has been made because "-1" is not
207a valid version number under the new "lax" criteria used internally by
f4baccf2 208C<UNIVERSAL::VERSION>. (See L<version> for more on "lax" version criteria.)
91710846
DG
209
210C<base> no longer internally skips loading modules it has already loaded and
211instead relies on C<require> to inspect C<%INC>. This fixes a bug when C<base>
212is used with code that clear C<%INC> to force a module to be reloaded.
213
214=item *
215
a2fa999d
CBW
216L<Digest> has been upgraded from version 1.16 to version 1.17.
217
218=item *
219
19e72bbf
FC
220L<DynaLoader> has been upgraded from version 1.13 to 1.14.
221
222It stopped exporting its symbols with the ExtUtils::ParseXS changes in
1e915955 2235.15.2. Now it exports them once more.
19e72bbf
FC
224
225=item *
226
7b8e5ef0
GG
227L<ExtUtils::MakeMaker> has been upgraded from version 6.59 to version 6.61_01.
228
bd65daab
CBW
229=item *
230
02e7ec6d 231L<ExtUtils::ParseXS> has been upgraded from version 3.04_04 to version 3.05.
bd65daab 232
3f2cb5bf
SM
233=item *
234
f0381222
FR
235L<Module::CoreList> has been upgraded from version 2.56 to 2.57.
236
237=item *
238
02e7ec6d
CBW
239L<Module::Load> has been upgraded from version 0.20 to version 0.22.
240
241Resolve possible security problem [http://goo.gl/YzHRU] where a '::' prefixed
242module can 'jump' out of @INC
243
244=item *
245
1e915955
CBW
246L<perlfaq> has been upgraded from version 5.0150034 to version 5.0150035.
247
248=item *
249
b2ef759e
CBW
250L<Unicode::Collate> has been upgraded from version 0.78 to version 0.80.
251
252Locales updated to CLDR 2.0: ar, be, bg, ha, hr, kk, lt.
253Newly 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
267As an accident of history, C<open $fh, "<:", ...> applies the default
268layers for the platform (C<:raw> on Unix, C<:crlf> on Windows), ignoring
269whatever is declared by L<open.pm|open>. This seems such a useful feature
270it 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
280The HV API has long accepted negative lengths to indicate that the key is
281in UTF8. Now this is documented.
282
9eb1e3e2
FR
283=item *
284
285The C<boolSV()> macro is now documented.
286
b53e16ae
FC
287=back
288
289=head3 L<perlguts>
290
291=over 4
292
293=item *
294
295A new section, L<Autoloading with XSUBs|perlguts/Autoloading with XSUBs>,
296has been added, which explains the two APIs for accessing the name of the
297autoloaded sub.
298
299=back
300
3432e5a1 301=head1 Diagnostics
83307084 302
3432e5a1
SL
303The following additions or changes have been made to diagnostic output,
304including warnings and fatal error messages. For the complete list of
305diagnostic 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
313The message,
314"Code point 0x%X is not Unicode, no properties match it; all inverse
315prop 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
326F<t/porting/checkcfgvar.t> now tests that all config.sh-style files are
327complete. These are used by the various non-*nix to generate their
328F<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
338These 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
370The gv_fetchmethod_*_flags functions, like gv_fetchmethod_flags, are
371experimental and may change in a future release.
372
373=item *
374
375The 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
387There is also a C<HEKf> macro corresponding to C<SVf>, for
388interpolating HEKs in formatted strings.
6d110ad0
FC
389
390=item *
391
392C<sv_catpvn_flags> takes a couple of new internal-only flags,
393C<SV_CATBYTES> and C<SV_CATUTF8>, which tell it whether the char array to
394be concatenated is UTF8. This allows for more efficient concatenation than
395creating temporary SVs to pass to C<sv_catsv>.
60092ce4 396
b53e16ae
FC
397=item *
398
399For XS AUTOLOAD subs, $AUTOLOAD is set once more, as it was in 5.6.0. This
400is in addition to setting C<SvPVX(cv)>, for compatibility with 5.8 to 5.14.
401See L<perlguts/Autoloading with XSUBs>.
402
403=item *
404
405Perl now checks whether the array (the linearised isa) returned by a MRO
406plugin begins with the name of the class itself, for which the array was
407created, instead of assuming that it does. This prevents the first element
408from being skipped during method lookup. It also means that
409C<mro::get_linear_isa> may return an array with one more element than the
410MRO 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
420In Perl 5.14.0, C<$tainted ~~ @array> stopped working properly. Sometimes
421it would erroneously fail (when C<$tainted> contained a string that occurs
422in the array I<after> the first element) or erroneously succeed (when
423C<undef> occurred after the first element) [perl #93590].
424
425=item *
426
427Perl 5.15.0 introduced a minor regression, in that an object referenced by
428a deleted hash element would be able to access the freed element from its
429DESTROY method, causing panic errors [perl #99660].
430
431=item *
432
433Functions in the CORE package can now be called as methods. That used to
434work only when they had been called or referenced already. So
435C<< "foo"->CORE::ucfirst >> returns Foo.
436
437=item *
438
439C<use> and C<require> are no longer affected by the I/O layers active in
440the caller's scope (enabled by L<open.pm|open>) [perl #96008].
441
442=item *
443
444Errors that occur when methods cannot be found during overloading now
445mention the correct package name, as they did in 5.8.x, instead of
446erroneously mentioning the "overload" package, as they have since 5.10.0.
447
448=item *
449
450Undefining C<%overload::> no longer causes a crash.
433644ee 451
6d110ad0
FC
452=item *
453
454C<our $::é; $é> (which is invalid) no longer produces the "Compilation
455error at lib/utf8_heavy.pl..." error message, which it started emitting in
4565.10.0 [perl #99984].
457
b377a702
KW
458=item *
459
460A minor regression, introduced Perl 5.15.0, has been fixed in which some
461regular expression Unicode property matches (C<\p{...}>) matched
462non-Unicode code points.
463
7c1b9f38
KW
464=item *
465
466In case-insensitive regular expression pattern matching, no longer on
467UTF-8 encoded strings does the scan for the start of match only look at
468the first possible position. This caused matches such as
469C<"f\x{FB00}" =~ /ff/i> to fail.
470
b53e16ae
FC
471=item *
472
473On 64-bit systems, C<read()> now understands large string offsets beyond
474the 32-bit range.
475
476=item *
477
478Errors that occur when processing subroutine attributes no longer cause the
479subroutine's op tree to leak.
480
481=item *
482
483C<sort> now works once more with custom sort routines that are XSUBs. It
484stopped working in 5.10.0.
485
486=item *
487
ca955add
FC
488C<sort> with a constant for a custom sort routine, although it produces
489unsorted results, no longer crashes. It started crashing in 5.10.0.
490
491=item *
492
b53e16ae
FC
493Warnings produced when a custom sort routine returns a non-numeric value
494now contain "in sort"; e.g., "Use of uninitialized value in sort".
495
496=item *
497
498C<< sort { $a <=> $b } >>, which is optimised internally, now produces
499"uninitialized" warnings for NaNs (not-a-number values), since C<< <=> >>
500returns C<undef> for those. This brings it in line with
501S<C<< sort { 1; $a <=> $b } >>> and other more complex cases, which are not
502optimised [perl #94390].
503
504=item *
505
506C<..> and C<...> in list context now call FETCH only once on tied
507arguments, instead of three or four times [perl #53554].
508
509=item *
510
511C<..> 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
a777c865
FR
518Perl 5.15.4 represents approximately 1 month of development since Perl 5.15.3
519and contains approximately 31,000 lines of changes across 350 files from 23
520authors.
521
522Perl continues to flourish into its third decade thanks to a vibrant community
523of users and developers. The following people are known to have contributed the
524improvements that became Perl 5.15.4:
525
526Alan Haggai Alavi, Brian Fraser, Chip Salzenberg, Chris 'BinGOs' Williams, Dave
527Rolsky, David Golden, David Mitchell, Dennis Kaarsemaker, Eric Brine, Father
528Chrysostomos, Florian Ragwitz, George Greer, Gerard Goossen, H.Merijn Brand,
529Jim Cromie, John P. Linderman, Karl Williamson, Nicholas Clark, Reini Urban,
530Steffen Müller, Stevan Little, Thorsten Glaser, Tony Cook.
531
532The list above is almost certainly incomplete as it is automatically generated
533from version control history. In particular, it does not include the names of
534the (very much appreciated) contributors who reported issues to the Perl bug
535tracker.
536
537Many of the changes included in this version originated in the CPAN modules
538included in Perl's core. We're grateful to the entire CPAN community for
539helping Perl to flourish.
540
541For a more complete list of all of Perl's historical contributors, please see
542the F<AUTHORS> file in the Perl source distribution.
29cf780c 543
44691e6f
AB
544=head1 Reporting Bugs
545
546If you find what you think is a bug, you might check the articles
34dc2ec0 547recently posted to the comp.lang.perl.misc newsgroup and the perl
44691e6f
AB
548bug database at http://rt.perl.org/perlbug/ . There may also be
549information at http://www.perl.org/ , the Perl Home Page.
550
551If you believe you have an unreported bug, please run the L<perlbug>
552program included with your release. Be sure to trim your bug down
553to a tiny but sufficient test case. Your bug report, along with the
554output of C<perl -V>, will be sent off to perlbug@perl.org to be
555analysed by the Perl porting team.
556
557If the bug you are reporting has security implications, which make it
558inappropriate to send to a publicly archived mailing list, then please send
34dc2ec0 559it to perl5-security-report@perl.org. This points to a closed subscription
b4707b2a
FC
560unarchived mailing list, which includes
561all the core committers, who will be able
44691e6f
AB
562to help assess the impact of issues, figure out a resolution, and help
563co-ordinate the release of patches to mitigate or fix the problem across all
34dc2ec0
DM
564platforms on which Perl is supported. Please only use this address for
565security issues in the Perl core, not for modules independently
44691e6f
AB
566distributed on CPAN.
567
568=head1 SEE ALSO
569
570The F<Changes> file for an explanation of how to view exhaustive details
571on what changed.
572
573The F<INSTALL> file for how to build Perl.
574
575The F<README> file for general stuff.
576
577The F<Artistic> and F<Copying> files for copyright information.
578
579=cut