This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Get perldelta into mostly finished state
[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
02e7ec6d
CBW
235L<Module::Load> has been upgraded from version 0.20 to version 0.22.
236
237Resolve possible security problem [http://goo.gl/YzHRU] where a '::' prefixed
238module can 'jump' out of @INC
239
240=item *
241
1e915955
CBW
242L<perlfaq> has been upgraded from version 5.0150034 to version 5.0150035.
243
244=item *
245
b2ef759e
CBW
246L<Unicode::Collate> has been upgraded from version 0.78 to version 0.80.
247
248Locales updated to CLDR 2.0: ar, be, bg, ha, hr, kk, lt.
249Newly supported locales: as, fi__phonebook, gu, hi, kn, kok and ln.
3f2cb5bf 250
3432e5a1 251=back
666c7ca6 252
3432e5a1 253=head1 Documentation
8fe353ef 254
3432e5a1 255=head2 Changes to Existing Documentation
7ac26854 256
19e72bbf 257=head3 L<perlfunc>, L<open>
daef35db 258
3432e5a1 259=over 4
83307084
SL
260
261=item *
262
19e72bbf
FC
263As an accident of history, C<open $fh, "<:", ...> applies the default
264layers for the platform (C<:raw> on Unix, C<:crlf> on Windows), ignoring
265whatever is declared by L<open.pm|open>. This seems such a useful feature
266it has been documented in L<perlfunc|perlfunc/open> and L<open>.
b420b12a 267
3432e5a1 268=back
b420b12a 269
b53e16ae
FC
270=head3 L<perlapi>
271
272=over 4
273
274=item *
275
276The HV API has long accepted negative lengths to indicate that the key is
277in UTF8. Now this is documented.
278
9eb1e3e2
FR
279=item *
280
281The C<boolSV()> macro is now documented.
282
b53e16ae
FC
283=back
284
285=head3 L<perlguts>
286
287=over 4
288
289=item *
290
291A new section, L<Autoloading with XSUBs|perlguts/Autoloading with XSUBs>,
292has been added, which explains the two APIs for accessing the name of the
293autoloaded sub.
294
295=back
296
3432e5a1 297=head1 Diagnostics
83307084 298
3432e5a1
SL
299The following additions or changes have been made to diagnostic output,
300including warnings and fatal error messages. For the complete list of
301diagnostic messages, see L<perldiag>.
83307084 302
3432e5a1
SL
303=head2 Changes to Existing Diagnostics
304
d6cf2367
FC
305=over 4
306
307=item *
308
c634fdd3
KW
309The message,
310"Code point 0x%X is not Unicode, no properties match it; all inverse
311prop erties do" has been changed to "Code point 0x%X is not Unicode, all
312\p{} matches fail; all \P{} matches succeed"
313
3432e5a1 314=back
9cfd094e 315
3432e5a1 316=head1 Testing
9cfd094e 317
3432e5a1 318=over 4
95f7e41f 319
83307084 320=item *
95f7e41f 321
6692294e
NC
322F<t/porting/checkcfgvar.t> now tests that all config.sh-style files are
323complete. These are used by the various non-*nix to generate their
324F<config.h>, and an incomplete input file will generate invalid output.
df5b44bd 325
63ac71b9 326=back
310913d4 327
3432e5a1 328=head1 Internal Changes
d6cf2367 329
3432e5a1 330=over 4
5d4ff231 331
a3342be3
FC
332=item *
333
6d110ad0
FC
334These new functions have been added as part of the work on Unicode symbols:
335
336 HvNAMELEN
337 HvNAMEUTF8
338 HvENAMELEN
339 HvENAMEUTF8
340 gv_init_pv
341 gv_init_pvn
342 gv_init_pvsv
343 gv_fetchmeth_pv
344 gv_fetchmeth_pvn
345 gv_fetchmeth_sv
346 gv_fetchmeth_pv_autoload
347 gv_fetchmeth_pvn_autoload
348 gv_fetchmeth_sv_autoload
349 gv_fetchmethod_pv_flags
350 gv_fetchmethod_pvn_flags
351 gv_fetchmethod_sv_flags
352 gv_autoload_pv
353 gv_autoload_pvn
354 gv_autoload_sv
355 newGVgen_flags
356 sv_derived_from_pv
357 sv_derived_from_pvn
358 sv_derived_from_sv
359 sv_does_pv
360 sv_does_pvn
361 sv_does_sv
362 whichsig_pv
363 whichsig_pvn
364 whichsig_sv
365
366The gv_fetchmethod_*_flags functions, like gv_fetchmethod_flags, are
367experimental and may change in a future release.
368
369=item *
370
371The following functions were added. These are I<not> part of the API:
372
373 GvNAMEUTF8
374 GvENAMELEN
375 GvENAME_HEK
376 CopSTASH_flags
377 CopSTASH_flags_set
378 PmopSTASH_flags
379 PmopSTASH_flags_set
380 sv_sethek
b53e16ae
FC
381 HEKfARG
382
383There is also a C<HEKf> macro corresponding to C<SVf>, for
384interpolating HEKs in formatted strings.
6d110ad0
FC
385
386=item *
387
388C<sv_catpvn_flags> takes a couple of new internal-only flags,
389C<SV_CATBYTES> and C<SV_CATUTF8>, which tell it whether the char array to
390be concatenated is UTF8. This allows for more efficient concatenation than
391creating temporary SVs to pass to C<sv_catsv>.
60092ce4 392
b53e16ae
FC
393=item *
394
395For XS AUTOLOAD subs, $AUTOLOAD is set once more, as it was in 5.6.0. This
396is in addition to setting C<SvPVX(cv)>, for compatibility with 5.8 to 5.14.
397See L<perlguts/Autoloading with XSUBs>.
398
399=item *
400
401Perl now checks whether the array (the linearised isa) returned by a MRO
402plugin begins with the name of the class itself, for which the array was
403created, instead of assuming that it does. This prevents the first element
404from being skipped during method lookup. It also means that
405C<mro::get_linear_isa> may return an array with one more element than the
406MRO plugin provided [perl #94306].
407
3432e5a1 408=back
60092ce4 409
3432e5a1 410=head1 Selected Bug Fixes
309aab3a 411
3432e5a1 412=over 4
1f26655e 413
433644ee
FC
414=item *
415
19e72bbf
FC
416In Perl 5.14.0, C<$tainted ~~ @array> stopped working properly. Sometimes
417it would erroneously fail (when C<$tainted> contained a string that occurs
418in the array I<after> the first element) or erroneously succeed (when
419C<undef> occurred after the first element) [perl #93590].
420
421=item *
422
423Perl 5.15.0 introduced a minor regression, in that an object referenced by
424a deleted hash element would be able to access the freed element from its
425DESTROY method, causing panic errors [perl #99660].
426
427=item *
428
429Functions in the CORE package can now be called as methods. That used to
430work only when they had been called or referenced already. So
431C<< "foo"->CORE::ucfirst >> returns Foo.
432
433=item *
434
435C<use> and C<require> are no longer affected by the I/O layers active in
436the caller's scope (enabled by L<open.pm|open>) [perl #96008].
437
438=item *
439
440Errors that occur when methods cannot be found during overloading now
441mention the correct package name, as they did in 5.8.x, instead of
442erroneously mentioning the "overload" package, as they have since 5.10.0.
443
444=item *
445
446Undefining C<%overload::> no longer causes a crash.
433644ee 447
6d110ad0
FC
448=item *
449
450C<our $::é; $é> (which is invalid) no longer produces the "Compilation
451error at lib/utf8_heavy.pl..." error message, which it started emitting in
4525.10.0 [perl #99984].
453
b377a702
KW
454=item *
455
456A minor regression, introduced Perl 5.15.0, has been fixed in which some
457regular expression Unicode property matches (C<\p{...}>) matched
458non-Unicode code points.
459
7c1b9f38
KW
460=item *
461
462In case-insensitive regular expression pattern matching, no longer on
463UTF-8 encoded strings does the scan for the start of match only look at
464the first possible position. This caused matches such as
465C<"f\x{FB00}" =~ /ff/i> to fail.
466
b53e16ae
FC
467=item *
468
469On 64-bit systems, C<read()> now understands large string offsets beyond
470the 32-bit range.
471
472=item *
473
474Errors that occur when processing subroutine attributes no longer cause the
475subroutine's op tree to leak.
476
477=item *
478
479C<sort> now works once more with custom sort routines that are XSUBs. It
480stopped working in 5.10.0.
481
482=item *
483
ca955add
FC
484C<sort> with a constant for a custom sort routine, although it produces
485unsorted results, no longer crashes. It started crashing in 5.10.0.
486
487=item *
488
b53e16ae
FC
489Warnings produced when a custom sort routine returns a non-numeric value
490now contain "in sort"; e.g., "Use of uninitialized value in sort".
491
492=item *
493
494C<< sort { $a <=> $b } >>, which is optimised internally, now produces
495"uninitialized" warnings for NaNs (not-a-number values), since C<< <=> >>
496returns C<undef> for those. This brings it in line with
497S<C<< sort { 1; $a <=> $b } >>> and other more complex cases, which are not
498optimised [perl #94390].
499
500=item *
501
502C<..> and C<...> in list context now call FETCH only once on tied
503arguments, instead of three or four times [perl #53554].
504
505=item *
506
507C<..> and C<...> in list context now mention the name of the variable in
508"uninitialized" warnings for string (as opposed to numeric) ranges.
509
63ac71b9 510=back
bbc28bfc 511
44691e6f
AB
512=head1 Acknowledgements
513
3432e5a1
SL
514XXX Generate this with:
515
516 perl Porting/acknowledgements.pl v5.15.3..HEAD
29cf780c 517
44691e6f
AB
518=head1 Reporting Bugs
519
520If you find what you think is a bug, you might check the articles
34dc2ec0 521recently posted to the comp.lang.perl.misc newsgroup and the perl
44691e6f
AB
522bug database at http://rt.perl.org/perlbug/ . There may also be
523information at http://www.perl.org/ , the Perl Home Page.
524
525If you believe you have an unreported bug, please run the L<perlbug>
526program included with your release. Be sure to trim your bug down
527to a tiny but sufficient test case. Your bug report, along with the
528output of C<perl -V>, will be sent off to perlbug@perl.org to be
529analysed by the Perl porting team.
530
531If the bug you are reporting has security implications, which make it
532inappropriate to send to a publicly archived mailing list, then please send
34dc2ec0 533it to perl5-security-report@perl.org. This points to a closed subscription
b4707b2a
FC
534unarchived mailing list, which includes
535all the core committers, who will be able
44691e6f
AB
536to help assess the impact of issues, figure out a resolution, and help
537co-ordinate the release of patches to mitigate or fix the problem across all
34dc2ec0
DM
538platforms on which Perl is supported. Please only use this address for
539security issues in the Perl core, not for modules independently
44691e6f
AB
540distributed on CPAN.
541
542=head1 SEE ALSO
543
544The F<Changes> file for an explanation of how to view exhaustive details
545on what changed.
546
547The F<INSTALL> file for how to build Perl.
548
549The F<README> file for general stuff.
550
551The F<Artistic> and F<Copying> files for copyright information.
552
553=cut