This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update perldelta
[perl5.git] / pod / perldelta.pod
1 =encoding utf8
2
3 =head1 NAME
4
5 [ this is a template for a new perldelta file. Any text flagged as
6 XXX needs to be processed before release. ]
7
8 perldelta - what is new for perl v5.15.5
9
10 =head1 DESCRIPTION
11
12 This document describes differences between the 5.15.4 release and
13 the 5.15.5 release.
14
15 If you are upgrading from an earlier release such as 5.15.3, first read
16 L<perl5154delta>, which describes differences between 5.15.3 and
17 5.15.4.
18
19 =head1 Core Enhancements
20
21 =head2 More consistent C<eval>
22
23 The C<eval> operator sometimes treats a string argument as a sequence of
24 characters and sometimes as a sequence of bytes, depending on the internal
25 encoding.  The internal encoding is not supposed to make any difference,
26 but there is code that relies on this inconsistency.
27
28 Under C<use v5.15> and higher, the C<unicode_eval> and C<evalbytes>
29 features resolve this.  The C<unicode_eval> feature causes C<eval $string>
30 to treat the string always as Unicode.  The C<evalbytes> features provides
31 a function, itself called C<evalbytes>, which evaluates its argument always
32 as a string of bytes.
33
34 These features also fix oddities with source filters leaking to outer
35 dynamic scopes.
36
37 See L<feature> for more detail.
38
39 =head2 C<$[> is back
40
41 The C<$[> variable is back again, but is now implemented as a module, so
42 programs that do not mention it (i.e., most of them), will not incur any
43 run-time penalty.  In a later release in the 5.15 branch it might be
44 disabled in the scope of C<use v5.16>.
45
46 The new implementation has some bug fixes.  See L<arybase>.
47
48 =head1 Security
49
50 =item Privileges are now set correctly when assigning to C<$(>
51
52 A hypothetical bug (probably non-exploitable in practice) due to the
53 incorrect setting of the effective group ID while setting C<$(> has been
54 fixed. The bug would only have affected systems that have C<setresgid()>
55 but not C<setregid()>, but no such systems are known of.
56
57 =head1 Incompatible Changes
58
59 =head2 Certain deprecated Unicode properties are no longer supported by default
60
61 Perl should never have exposed certain Unicode properties that are used
62 by Unicode internally and not meant to be publicly available.  Use of
63 these has generated deprecated warning messages since Perl 5.12.  The
64 removed properties are Other_Alphabetic,
65 Other_Default_Ignorable_Code_Point, Other_Grapheme_Extend,
66 Other_ID_Continue, Other_ID_Start, Other_Lowercase, Other_Math, and
67 Other_Uppercase.
68
69 Perl may be recompiled to include any or all of them; instructions are
70 given in
71 L<perluniprops/Unicode character properties that are NOT accepted by Perl>.
72
73 =head2 Dereferencing IO thingies as typeglobs
74
75 The C<*{...}> operator, when passed a reference to an IO thingy (as in
76 C<*{*STDIN{IO}}>), creates a new typeglob containing just that IO object.
77
78 Previously, it would stringify as an empty string, but some operators would
79 treat it as undefined, producing an "uninitialized" warning.
80
81 Having a typeglob appear as an empty string is a side effect of the
82 implementation that has caused various bugs over the years.
83
84 The solution was to make it stringify like a normal anonymous typeglob,
85 like those produced by C<open($foo->{bar}, ...)> [perl #96326].
86
87 =head1 Deprecations
88
89 =head2 Don't read the Unicode data base files in F<lib/unicore>
90
91 It is now deprecated to directly read the Unicode data base files.
92 These are stored in the F<lib/unicore> directory.  Instead, you should
93 use the new functions in L<Unicode::UCD>.  These provide a stable API,
94 and give complete information.  (This API is, however, subject to change
95 somewhat during the 5.15 development cycle, as we gain experience and
96 get feedback from using it.)
97
98 Perl may at some point in the future change or remove the files.  The
99 file most likely for applications to have used is F<lib/unicore/ToDigit.pl>.
100 L<Unicode::UCD/prop_invmap()> can be used to get at its data instead.
101
102 =head1 Performance Enhancements
103
104 =over 4
105
106 =item *
107
108 Due to changes in L<File::Glob>, Perl's C<glob> function and its
109 C<< <...> >> equivalent are now much faster.  The splitting of the pattern
110 into words has been rewritten in C, resulting in speed-ups of 20% in some
111 cases.
112
113 This does not affect VMS, as it does not use File::Glob.
114
115 =back
116
117 =head1 Modules and Pragmata
118
119 =head2 New Modules and Pragmata
120
121 =over 4
122
123 =item *
124
125 L<arybase> -- this new module implements the C<$[> variable.
126
127 =back
128
129 =head2 Updated Modules and Pragmata
130
131 =over 4
132
133 =item *
134
135 L<Archive::Extract> has been upgraded from version 0.56 to version 0.58.
136
137 =item *
138
139 L<B::Concise> has been upgraded from version 0.86 to version 0.87.
140
141 =item *
142
143 L<B::Deparse> has been upgraded from version 1.08 to version 1.09.
144
145 It now correctly deparses C<CORE::do>, C<CORE::glob> and slices of empty
146 lists.
147
148 =item *
149
150 L<CGI> has been upgraded from version 3.55 to version 3.58.
151
152 Use public and documented FCGI.pm API in CGI::Fast
153 CGI::Fast was using an FCGI API that was deprecated and removed from
154 documentation more than ten years ago. Usage of this deprecated API with
155 FCGI >= 0.70 or FCGI <= 0.73 introduces a security issue.
156 L<https://rt.cpan.org/Public/Bug/Display.html?id=68380>
157 L<http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-2766>
158
159 =item *
160
161 L<charnames> has been upgraded from version 1.23 to version 1.24.
162
163 =item *
164
165 L<Compress::Raw::Bzip2> has been upgraded from version 2.037 to version 2.042.
166
167 =item *
168
169 L<Compress::Raw::Zlib> has been upgraded from version 2.037 to version 2.042.
170
171 =item *
172
173 L<Compress::Zlib> has been upgraded from version 2.037 to version 2.042.
174
175 =item *
176
177 L<CPANPLUS> has been upgraded from version 0.9111 to version 0.9112.
178
179 =item *
180
181 L<CPANPLUS::Dist::Build> has been upgraded from version 0.58 to version 0.60.
182
183 =item *
184
185 L<Digest::SHA> has been upgraded from version 5.62 to version 5.63.
186
187 Added code to allow very large data inputs all at once, which had previously been
188 limited to several hundred megabytes at a time
189
190 =item *
191
192 L<Errno> has been upgraded from version 1.14 to version 1.15.
193
194 Choosing an archname containing a @, $ or % character no longer results in
195 unintended interpolation in Errno's architecture check.
196
197 =item *
198
199 L<ExtUtils::MakeMaker> has been upgraded from version 6.61_01 to version 6.63_02.
200
201 =item *
202
203 L<feature> has been upgraded from version 1.22 to version 1.23.
204
205 =item *
206
207 L<File::DosGlob> has been upgraded from version 1.05 to version 1.06.
208
209 =item *
210
211 L<File::Glob> has been upgraded from version 1.13 to version 1.14.
212
213 It has a new C<:bsd_glob> export tag, intended to replace C<:glob>.  Like
214 C<:glob> it overrides C<glob> with a function that does not split the glob
215 pattern into words, but, unlike C<:glob>, it iterates properly in scalar
216 context, instead of returning the last file.
217
218 There are other changes affecting Perl's own C<glob> operator (which uses
219 File::Glob internally, except on VMS).  See L</Performance Enhancements>
220 and L</Selected Bug Fixes>.
221
222 =item *
223
224 L<HTTP::Tiny> has been upgraded from version 0.013 to version 0.016.
225
226 Adds additional shorthand methods for all common HTTP verbs,
227 a C<post_form()> method for POST-ing x-www-form-urlencoded data and
228 a C<www_form_urlencode()> utility method.
229
230 =item *
231
232 L<Opcode> has been upgraded from version 1.20 to version 1.21.
233
234 =item *
235
236 L<perlfaq> has been upgraded from version 5.0150035 to version 5.0150036.
237
238 =item *
239
240 L<Socket> as been upgraded from version 1.94_01 to 1.94_02.
241
242 It has new functions and constants for handling IPv6 sockets:
243
244     pack_ipv6_mreq
245     unpack_ipv6_mreq
246     IPV6_ADD_MEMBERSHIP
247     IPV6_DROP_MEMBERSHIP
248     IPV6_MTU
249     IPV6_MTU_DISCOVER
250     IPV6_MULTICAST_HOPS
251     IPV6_MULTICAST_IF
252     IPV6_MULTICAST_LOOP
253     IPV6_UNICAST_HOPS
254     IPV6_V6ONLY
255
256 =item *
257
258 L<Storable> has been upgraded from version 2.32 to 2.33.
259
260 The ability to add a fake entry to %INC to prevent Log::Agent from loading
261 has been restored.  In version 2.27 (included with perl 5.14.0), Storable
262 starting producing an error instead.
263
264 =item *
265
266 L<strict> has been upgraded from version 1.04 to version 1.05.
267
268 =item *
269
270 L<Unicode::Collate> has been upgraded from version 0.80 to version 0.85.
271
272 Locales updated to CLDR 2.0: mk, mt, nb, nn, ro, ru, sk, sr, sv, uk,
273 zh__pinyin, zh__stroke
274 Newly supported locales: bn, fa, ml, mr, or, pa, sa, si, si__dictionary,
275 sr_Latn, sv__reformed, ta, te, th, ur, wae.
276
277 =item *
278
279 L<Unicode::UCD> has been upgraded from version 0.36 to version 0.37.
280
281 This adds four new functions:  C<prop_aliases()>, and
282 C<prop_value_aliases()> which are used to find all the Unicode-approved
283 synonyms for property names, or to convert from one name to another;
284 C<prop_invlist> which returns all the code points matching a given
285 Unicode binary property; and C<prop_invmap> which returns the complete
286 specification of a given Unicode property.
287
288 =item *
289
290 L<UNIVERSAL> has been upgraded from version 1.09 to version 1.10.
291
292 =back
293
294 =head1 Diagnostics
295
296 The following additions or changes have been made to diagnostic output,
297 including warnings and fatal error messages.  For the complete list of
298 diagnostic messages, see L<perldiag>.
299
300 =head2 New Diagnostics
301
302 =head3 New Errors
303
304 =over 4
305
306 =item *
307
308 L<Source filters apply only to byte streams|perldiag/"Source filters apply only to byte streams">
309
310 This new error occurs when you try to activate a source filter (usually by
311 loading a source filter module) within a string passed to C<eval> under the
312 C<unicode_eval> feature.
313
314 =item *
315
316 L<That use of $[ is unsupported|perldiag/"That use of $[ is unsupported">
317
318 This previously removed error has been restored with the re-implementation
319 of C<$[> as a module.
320
321 =back
322
323 =head3 New Warnings
324
325 =over 4
326
327 =item *
328
329 L<length() used on %s|perldiag/length() used on %s>
330
331 This new warning occurs when C<length> is used on an array or hash, instead
332 of C<scalar(@array)> or C<scalar(keys %hash)>.
333
334 =item *
335
336 L<$[ used in %s (did you mean $] ?)|perldiag/"$[ used in %s (did you mean $] ?)">
337
338 This new warning exists to catch the mistaken use of C<$[> in version
339 checks.  C<$]>, not C<$[>, contains the version number.  C<$[> in a numeric
340 comparison is almost always wrong.
341
342 =item *
343
344 <Use of assignment to $[ is deprecated|perldiag/"Use of assignment to $[ is deprecated">
345
346 This previously removed warning has been restored with the re-implementation
347 of C<$[> as a module.
348
349 =back
350
351 =head2 Changes to Existing Diagnostics
352
353 =over 4
354
355 =item *
356
357 The uninitialized warning for C<y///r> when C<$_> is implicit and undefined
358 now mentions the variable name, just like the non-/r variation of the
359 operator.
360
361 =item *
362
363 The "Applying pattern match..." or similar warning produced when an array
364 or hash is on the left-hand side of the C<=~> operator now mentions the
365 name of the variable.
366
367 =back
368
369 =head1 Configuration and Compilation
370
371 =over 4
372
373 =item *
374
375 F<pod/buildtoc>, used by the build process to build L<perltoc>, has been
376 refactored and simplified. It now only contains code to build L<perltoc>;
377 the code to regenerate Makefiles has been moved to F<Porting/pod_rules.pl>.
378 It's a bug if this change has any material effect on the build process.
379
380 =back
381
382 =head1 Platform Support
383
384 =head2 Platform-Specific Notes
385
386 =over 4
387
388 =item GNU/Hurd
389
390 Numerous build and test failures on GNU/Hurd have been resolved with hints
391 for building DBM modules, detection of the library search path, and enabling
392 of large file support.
393
394 =item OpenVOS
395
396 Perl is now built with dynamic linking on OpenVOS, the minimum supported
397 version of which is now Release 17.1.0.
398
399 =item SunOS
400
401 The CC workshop C++ compiler is now detected and used on systems that ship
402 without cc.
403
404 =back
405
406 =head1 Internal Changes
407
408 =over 4
409
410 =item *
411
412 C<PL_curstash> is now reference-counted.
413
414 =back
415
416 =head1 Selected Bug Fixes
417
418 =over 4
419
420 =item *
421
422 Perl now holds an extra reference count on the package that code is
423 currently compiling in.  This means that the following code no longer crashes [perl #101486]:
424
425     package Foo;
426     BEGIN {*Foo:: = *Bar::}
427     sub foo;
428
429 =item *
430
431 F<dumpvar.pl>, and consequently the C<x> command in the debugger, have been
432 fixed to handle objects blessed into classes whose names contain "=".  The
433 contents of such objects used not to be dumped [perl #101814].
434
435 =item *
436
437 The C<x> repetition operator no longer crashes on 64-bit builds with large
438 repeate counts [perl #94560].
439
440 =item *
441
442 A fix to C<glob> under miniperl (used to configure modules when perl itself
443 is built) in Perl 5.15.3 stopped C<< <~> >> from returning the home
444 directory, because it cleared %ENV before calling csh.  Now C<$ENV{HOME}>
445 is preserved.  This fix probably does not affect anything.  If
446 L<File::Glob> fails to load for some reason, Perl reverts to using csh.
447 So it would apply in that case.
448
449 =item *
450
451 On OSes other than VMS, Perl's C<glob> operator (and the C<< <...> >> form)
452 use L<File::Glob> underneath.  L<File::Glob> splits the pattern into words,
453 before feeding each word to its C<bsd_glob> function.
454
455 There were several inconsistencies in the way the split was done.  Now
456 quotation marks (' and ") are always treated as shell-style word delimiters
457 (that allow whitespace as part of a word) and backslashes are always
458 preserved, unless they exist to escape quotation marks.  Before, those
459 would only sometimes be the case, depending on whether the pattern
460 contained whitespace.  Also, escaped whitespace at the end of the pattern
461 is no longer stripped [perl #40470].
462
463 =item *
464
465 C<CORE::glob> now works as a way to call the default globbing function.  It
466 used to respect overrides, despite the C<CORE::> prefix.
467
468 =item *
469
470 In 5.14, C</[[:lower:]]/i> and C</[[:upper:]]/i> no longer matched the
471 opposite case.  This has been fixed [perl #101970].
472
473 =item *
474
475 A regular expression match with an overloaded object on the right-hand side
476 would in some cases stringify the object too many times.
477
478 =item *
479
480 The C-level C<pregcomp> function could become confused as to whether the
481 pattern was in UTF8 if the pattern was an overloaded, tied, or otherwise
482 magical scalar [perl #101940].
483
484 =item *
485
486 A regression has been fixed that was introduced in 5.14, in C</i>
487 regular expression matching, in which a match improperly fails if the
488 pattern is in UTF-8, the target string is not, and a Latin-1 character
489 precedes a character in the string that should match the pattern.  [perl
490 #101710]
491
492 =item *
493
494 C<@{"..."} = reverse ...> started crashing in 5.15.3.  This has been fixed.
495
496 =item *
497
498 C<ref> in a tainted expression started producing an "sv_upgrade" error in
499 5.15.4.  This has been fixed.
500
501 =item *
502
503 Weak references to lexical hashes going out of scope were not going stale
504 (becoming undefined), but continued to point to the hash.
505
506 =item *
507
508 Weak references to lexical variables going out of scope are now broken
509 before any magical methods (e.g., DESTROY on a tie object) are called.
510 This prevents such methods from modifying the variable that will be seen
511 the next time the scope is entered.
512
513 =item *
514
515 A C<keys> optimisation in Perl 5.12.0 to make it faster on empty hashes
516 caused C<each> not to reset the iterator if called after the last element
517 was deleted.  This has been fixed.
518
519 =item *
520
521 The C<#line 42 foo> directive used not to update the arrays of lines used
522 by the debugger if it occurred in a string eval.  This was partially fixed
523 in 5.14, but it only worked for a single C<#line 42 foo> in each eval.  Now
524 it works for multiple.
525
526 =item *
527
528 String eval used not to localise C<%^H> when compiling its argument if it
529 was empty at the time the C<eval> call itself was compiled.  This could
530 lead to scary side effects, like C<use re "/m"> enabling other flags that
531 the surrounding code was trying to enable for its caller [perl #68750].
532
533 =item *
534
535 Creating a BEGIN block from XS code (via C<newXS> or C<newATTRSUB>) would,
536 on completion, make the hints of the current compiling code the current
537 hints.  This could cause warnings to occur in a non-warning scope.
538
539 =item *
540
541 C<eval $string> and C<require> no longer localise hints (C<$^H> and C<%^H>)
542 at run time, but only during compilation of the $string or required file.
543 This makes C<BEGIN { $^H{foo}=7 }> equivalent to
544 C<BEGIN { eval '$^H{foo}=7' }> [perl #70151].
545
546 =item *
547
548 When subroutine calls are intercepted by the debugger, the name of the
549 subroutine or a reference to it is stored in C<$DB::sub>, for the debugger
550 to access.  In some cases (such as C<$foo = *bar; undef *bar; &$foo>)
551 C<$DB::sub> would be set to a name that could not be used to find the
552 subroutine, and so the debugger's attempt to call it would fail.  Now the
553 check to see whether a reference is needed is more robust, so those
554 problems should not happen anymore [rt.cpan.org #69862].
555
556 =item *
557
558 Localising a tied scalar that returns a typeglob no longer stops it from
559 being tied till the end of the scope.
560
561 =item *
562
563 When C<open> is called with three arguments, the third being a file handle
564 (as in C<< open $fh, ">&", $fh2 >>), if the third argument is tied or a
565 reference to a tied variable, FETCH is now called exactly once, instead of
566 0, 2, or 3 times (all of which could occur in various circumstances).
567
568 =item *
569
570 C<sort> no longer ignores FETCH when passed a reference to a tied glob for
571 the comparison routine.
572
573 =item *
574
575 Warnings emitted by C<sort> when a custom comparison routine returns a
576 non-numeric value now show the line number of the C<sort> operator, rather
577 than the last line of the comparison routine.  The warnings also occur now
578 only if warnings are enabled in the scope where C<sort> occurs.  Previously
579 the warnings would occur if enabled in the comparison routine's scope.
580
581 =item *
582
583 C<Internals::SvREFCNT> now behaves consistently in 'get' and 'set' scenarios
584 [perl #103222] and also treats the reference count as unsigned.
585
586 =back
587
588 =head1 Acknowledgements
589
590 XXX Generate this with:
591
592   perl Porting/acknowledgements.pl v5.15.4..HEAD
593
594 =head1 Reporting Bugs
595
596 If you find what you think is a bug, you might check the articles
597 recently posted to the comp.lang.perl.misc newsgroup and the perl
598 bug database at http://rt.perl.org/perlbug/ .  There may also be
599 information at http://www.perl.org/ , the Perl Home Page.
600
601 If you believe you have an unreported bug, please run the L<perlbug>
602 program included with your release.  Be sure to trim your bug down
603 to a tiny but sufficient test case.  Your bug report, along with the
604 output of C<perl -V>, will be sent off to perlbug@perl.org to be
605 analysed by the Perl porting team.
606
607 If the bug you are reporting has security implications, which make it
608 inappropriate to send to a publicly archived mailing list, then please send
609 it to perl5-security-report@perl.org. This points to a closed subscription
610 unarchived mailing list, which includes
611 all the core committers, who will be able
612 to help assess the impact of issues, figure out a resolution, and help
613 co-ordinate the release of patches to mitigate or fix the problem across all
614 platforms on which Perl is supported. Please only use this address for
615 security issues in the Perl core, not for modules independently
616 distributed on CPAN.
617
618 =head1 SEE ALSO
619
620 The F<Changes> file for an explanation of how to view exhaustive details
621 on what changed.
622
623 The F<INSTALL> file for how to build Perl.
624
625 The F<README> file for general stuff.
626
627 The F<Artistic> and F<Copying> files for copyright information.
628
629 =cut