This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
cc5cc2344274f4bfe8942b5a405b39159ba95f8b
[perl5.git] / pod / perldelta.pod
1 =encoding utf8
2
3 =for comment
4 This has been completed up to 7cb18e1b02, except for:
5 04777d295957ad270188e4debf51b523e07cc5b0
6 c565ab54dc649bb62cd4d57149d7b2abb21df5f3
7 1c8d11ca3d0ce8bc11562f159b94c2c7e62dea6c
8
9 =head1 NAME
10
11 [ this is a template for a new perldelta file. Any text flagged as
12 XXX needs to be processed before release. ]
13
14 perldelta - what is new for perl v5.13.7
15
16 =head1 DESCRIPTION
17
18 This document describes differences between the 5.13.6 release and
19 the 5.13.7 release.
20
21 If you are upgrading from an earlier release such as 5.13.5, first read
22 L<perl5136delta>, which describes differences between 5.13.5 and
23 5.13.6.
24
25 =head1 Notice
26
27 XXX Any important notices here
28
29 =head1 Core Enhancements
30
31 XXX New core language features go here. Summarise user-visible core language
32 enhancements. Particularly prominent performance optimisations could go
33 here, but most should go in the L</Performance Enhancements> section.
34
35 [ List each enhancement as a =head2 entry ]
36
37 =head2 Single term prototype
38
39 The C<+> prototype is a special alternative to C<$> that will act like
40 C<\[@%]> when given a literal array or hash variable, but will otherwise
41 force scalar context on the argument.  This is useful for functions which
42 should accept either a literal array or an array reference as the argument:
43
44     sub smartpush (+@) {
45         my $aref = shift;
46         die "Not an array or arrayref" unless ref $aref eq 'ARRAY';
47         push @$aref, @_;
48     }
49
50 When using the C<+> prototype, your function must check that the argument
51 is of an acceptable type.
52
53 =head2 C<use re '/flags';>
54
55 The C<re> pragma now has the ability to turn on regular expression flags
56 till the end of the lexical scope:
57
58     use re '/x';
59     "foo" =~ / (.+) /;  # /x implied
60
61 See L<re/'/flags' mode> for details.
62
63 =head2 Statement labels can appear in more places
64
65 Statement labels can now occur before any type of statement or declaration,
66 such as C<package>.
67
68 =head2 C<use feature "unicode_strings"> now applies to more regex matching
69
70 Another chunk of the L<perlunicode/The "Unicode Bug"> is fixed in this
71 release.  Now, regular expressions compiled within the scope of the
72 "unicode_strings" feature (or under the "u" regex modifier (specifiable
73 currently only with infix notation C<(?u:...)> or via C<use re '/u'>)
74 will match the same whether or not the target string is encoded in utf8,
75 with regard to C<[[:posix:]]> character classes
76
77 Work is underway to add the case sensitive matching to the control of
78 this feature, but was not complete in time for this dot release.
79
80 =head1 Security
81
82 XXX Any security-related notices go here.  In particular, any security
83 vulnerabilities closed should be noted here rather than in the
84 L</Selected Bug Fixes> section.
85
86 [ List each security issue as a =head2 entry ]
87
88 =head1 Incompatible Changes
89
90 XXX For a release on a stable branch, this section aspires to be:
91
92     There are no changes intentionally incompatible with 5.XXX.XXX. If any
93     exist, they are bugs and reports are welcome.
94
95 [ List each incompatible change as a =head2 entry ]
96
97 =head2 Dereferencing typeglobs
98
99 If you assign a typeglob to a scalar variable:
100
101     $glob = *foo;
102
103 the glob that is copied to C<$glob> is marked with a special flag
104 indicating that the glob is just a copy. This allows subsequent assignments
105 to C<$glob> to overwrite the glob. The original glob, however, is
106 immutable.
107
108 Many Perl operators did not distinguish between these two types of globs.
109 This would result in strange behaviour in edge cases: C<untie $scalar>
110 would do nothing if the last thing assigned to the scalar was a glob
111 (because it treated it as C<untie *$scalar>, which unties a handle).
112 Assignment to a glob slot (e.g., C<(*$glob) = \@some_array>) would simply
113 assign C<\@some_array> to C<$glob>.
114
115 To fix this, the C<*{}> operator (including the C<*foo> and C<*$foo> forms)
116 has been modified to make a new immutable glob if its operand is a glob
117 copy. Various operators that make a distinction between globs and scalars
118 have been modified to treat only immutable globs as globs.
119
120 This causes an incompatible change in code that assigns a glob to the
121 return value of C<*{}> when that operator was passed a glob copy. Take the
122 following code, for instance:
123
124     $glob = *foo;
125     *$glob = *bar;
126
127 The C<*$glob> on the second line returns a new immutable glob. That new
128 glob is made an alias to C<*bar>. Then it is discarded.
129
130 The upside to this incompatible change is that bugs
131 L<[perl #77496]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77496>,
132 L<[perl #77502]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77502>,
133 L<[perl #77508]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77508>,
134 L<[perl #77688]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77688>,
135 and
136 L<[perl #77812]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77812>,
137 and maybe others, too, have been fixed.
138
139 See L<http://rt.perl.org/rt3/Public/Bug/Display.html?id=77810> for even
140 more detail.
141
142 =head1 Deprecations
143
144 XXX Any deprecated features, syntax, modules etc. should be listed here.
145 In particular, deprecated modules should be listed here even if they are
146 listed as an updated module in the L</Modules and Pragmata> section.
147
148 [ List each deprecation as a =head2 entry ]
149
150 =head1 Performance Enhancements
151
152 XXX Changes which enhance performance without changing behaviour go here. There
153 may well be none in a stable release.
154
155 [ List each enhancement as a =item entry ]
156
157 =over 4
158
159 =item *
160
161 XXX
162
163 =back
164
165 =head1 Modules and Pragmata
166
167 XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
168 go here.  If Module::CoreList is updated, generate an initial draft of the
169 following sections using F<Porting/corelist-perldelta.pl>, which prints stub
170 entries to STDOUT.  Results can be pasted in place of the '=head2' entries
171 below.  A paragraph summary for important changes should then be added by hand.
172 In an ideal world, dual-life modules would have a F<Changes> file that could be
173 cribbed.
174
175 [ Within each section, list entries as a =item entry ]
176
177 =head2 New Modules and Pragmata
178
179 =over 4
180
181 =item *
182
183 C<Unicode::Collate::CJK::JISX0208> module was added by the C<Unicode::Collate>
184 upgrade from 0.63 to 0.64. See below.
185
186 =back
187
188 =head2 Updated Modules and Pragmata
189
190 =over 4
191
192 =item *
193
194 C<Archive::Extract> has been upgraded from 0.44 to 0.46
195
196 Resolves an issue with NetBSD-current and its new unzip 
197 executable.
198
199 =item *
200
201 C<B> has been upgraded from 1.24 to 1.25.
202
203 =item *
204
205 C<B::Deparse> has been upgraded from 0.99 to 1.01.
206
207 It fixes deparsing of C<our> followed by a variable with funny characters
208 (as permitted under the C<utf8> pragma)
209 L<[perl #33752]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=33752>.
210
211 =item *
212
213 C<CPAN> has been upgraded from 1.94_61 to 1.94_62
214
215 =item *
216
217 C<CPANPLUS> has been upgraded from 0.9007 to 0.9010
218
219 Fixes for the SQLite source engine and resolving of issues with the
220 testsuite when run under local::lib and/or cpanminus
221
222 =item *
223
224 C<CPANPLUS::Dist::Build> has been upgraded from 0.48 to 0.50
225
226 =item *
227
228 C<ExtUtils::Constant> has been upgraded from 0.22 to 0.23.
229
230 =item *
231
232 C<Fcntl> has been upgraded from 1.09 to 1.10.
233
234 =item *
235
236 C<File::Glob> has been upgraded from 1.09 to 1.10.
237
238 =item *
239
240 C<GDBM_File> has been upgraded from 1.11 to 1.12.
241
242 This fixes a memory leak when DBM filters are used.
243
244 =item *
245
246 C<Hash::Util> has been upgraded from 0.09 to 0.10.
247
248 =item *
249
250 C<Hash::Util::FieldHash> has been upgraded from 1.05 to 1.06.
251
252 =item *
253
254 C<I18N::Langinfo> has been upgraded from 0.06 to 0.07.
255
256 =item *
257
258 C<Locale::Maketext> has been upgraded from 1.16 to 1.17
259
260 =item *
261
262 C<Math::BigInt::FastCalc> has been upgraded from 0.22 to 0.23.
263
264 =item *
265
266 C<mro> has been upgraded from 1.04 to 1.05.
267
268 =item *
269
270 C<NDBM_File> has been upgraded from 1.09 to 1.10.
271
272 This fixes a memory leak when DBM filters are used.
273
274 =item *
275
276 C<ODBM_File> has been upgraded from 1.08 to 1.09.
277
278 This fixes a memory leak when DBM filters are used.
279
280 =item *
281
282 C<parent> has been upgraded from 0.223 to 0.224
283
284 =item *
285
286 C<POSIX> has been upgraded from 1.21 to 1.22.
287
288 =item *
289
290 C<re> has been upgraded from 0.13 to 0.14, for the sake of the new
291 C<use re "/flags"> pragma.
292
293 =item *
294
295 C<Safe> has been upgraded from 2.28 to 2.29.
296
297 It adds C<&version::vxs::VCMP> to the default share.
298
299 =item *
300
301 C<SDBM_File> has been upgraded from 1.07 to 1.08.
302
303 =item *
304
305 C<SelfLoader> has been upgraded from 1.17 to 1.18.
306
307 It now works in taint mode
308 L<[perl #72062]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=72062>.
309
310 =item *
311
312 C<Socket> has been upgraded from 1.90 to 1.91.
313
314 =item *
315
316 C<Sys::Hostname> has been upgraded from 1.13 to 1.14.
317
318 =item *
319
320 C<Unicode::Collate> has been upgraded from 0.63 to 0.64
321
322 This release newly adds locale C<ja> and the module
323 C<Unicode::Collate::CJK::JISX0208> which makes tailoring of 6355 kanji 
324 (CJK Unified Ideographs) in the JIS X 0208 order.
325
326 =back
327
328 =head2 Removed Modules and Pragmata
329
330 =over 4
331
332 =item *
333
334 XXX
335
336 =back
337
338 =head1 Documentation
339
340 XXX Changes to files in F<pod/> go here.  Consider grouping entries by
341 file and be sure to link to the appropriate page, e.g. L<perlfunc>.
342
343 =head2 New Documentation
344
345 XXX Changes which create B<new> files in F<pod/> go here.
346
347 =head3 L<XXX>
348
349 XXX Description of the purpose of the new file here
350
351 =head2 Changes to Existing Documentation
352
353 XXX Changes which significantly change existing files in F<pod/> go here.
354 However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
355 section.
356
357 =over
358
359 =item *
360
361 Array and hash slices in scalar context are now documented in L<perldata>.
362
363 =item *
364
365 L<perlform> and L<perllocale> have been corrected to state that
366 C<use locale> affects formats.
367
368 =back
369
370 =head3 L<XXX>
371
372 =over 4
373
374 =item *
375
376 XXX Description of the change here
377
378 =back
379
380 =head1 Diagnostics
381
382 The following additions or changes have been made to diagnostic output,
383 including warnings and fatal error messages.  For the complete list of
384 diagnostic messages, see L<perldiag>.
385
386 XXX New or changed warnings emitted by the core's C<C> code go here. Also
387 include any changes in L<perldiag> that reconcile it to the C<C> code.
388
389 [ Within each section, list entries as a =item entry ]
390
391 =head2 New Diagnostics
392
393 XXX Newly added diagnostic messages go here
394
395 =over 4
396
397 =item *
398
399 XXX
400
401 =back
402
403 =head2 Changes to Existing Diagnostics
404
405 XXX Changes (i.e. rewording) of diagnostic messages go here
406
407 =over 4
408
409 =item *
410
411 XXX
412
413 =back
414
415 =head1 Utility Changes
416
417 XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go
418 here. Most of these are built within the directories F<utils> and F<x2p>.
419
420 [ List utility changes as a =head3 entry for each utility and =item
421 entries for each change
422 Use L<XXX> with program names to get proper documentation linking. ]
423
424 =head3 L<XXX>
425
426 =over 4
427
428 =item *
429
430 XXX
431
432 =back
433
434 =head1 Configuration and Compilation
435
436 XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
437 go here.  Any other changes to the Perl build process should be listed here.
438 However, any platform-specific changes should be listed in the
439 L</Platform Support> section, instead.
440
441 [ List changes as a =item entry ].
442
443 =over 4
444
445 =item *
446
447 XXX
448
449 =back
450
451 =head1 Testing
452
453 XXX Any significant changes to the testing of a freshly built perl should be
454 listed here.  Changes which create B<new> files in F<t/> go here as do any
455 large changes to the testing harness (e.g. when parallel testing was added).
456 Changes to existing files in F<t/> aren't worth summarising, although the bugs
457 that they represent may be covered elsewhere.
458
459 [ List each test improvement as a =item entry ]
460
461 =over 4
462
463 =item *
464
465 XXX
466
467 =back
468
469 =head1 Platform Support
470
471 XXX Any changes to platform support should be listed in the sections below.
472
473 [ Within the sections, list each platform as a =item entry with specific
474 changes as paragraphs below it. ]
475
476 =head2 New Platforms
477
478 XXX List any platforms that this version of perl compiles on, that previous
479 versions did not. These will either be enabled by new files in the F<hints/>
480 directories, or new subdirectories and F<README> files at the top level of the
481 source tree.
482
483 =over 4
484
485 =item XXX-some-platform
486
487 XXX
488
489 =back
490
491 =head2 Discontinued Platforms
492
493 XXX List any platforms that this version of perl no longer compiles on.
494
495 =over 4
496
497 =item XXX-some-platform
498
499 XXX
500
501 =back
502
503 =head2 Platform-Specific Notes
504
505 XXX List any changes for specific platforms. This could include configuration
506 and compilation changes or changes in portability/compatibility.  However,
507 changes within modules for platforms should generally be listed in the
508 L</Modules and Pragmata> section.
509
510 =over 4
511
512 =item Windows
513
514 Directory handles are now properly cloned when threads are created. In perl
515 5.13.6, child threads simply stopped inheriting directory handles. In
516 previous versions, threads would share handles, resulting in crashes.
517
518 =back
519
520 =head1 Internal Changes
521
522 XXX Changes which affect the interface available to C<XS> code go here.
523 Other significant internal changes for future core maintainers should
524 be noted as well.
525
526 [ List each test improvement as a =item entry ]
527
528 =over 4
529
530 =item *
531
532 C<lex_start> has been added to the API, but is considered experimental.
533
534 =item *
535
536 A new C<parse_block> function has been added to the API
537 L<[perl #78222]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78222>.
538
539 =item *
540
541 A new, experimental API has been added for accessing the internal
542 structure that Perl uses for C<%^H>. See the functions beginning with
543 C<cophh_> in L<perlapi>.
544
545 =item *
546
547 A stash can now have a list of effective names in addition to its usual
548 name. The first effective name can be accessed via the C<HvENAME> macro,
549 which is now the recommended name to use in MRO linearisations (C<HvNAME>
550 being a fallback if there is no C<HvENAME>).
551
552 These names are added and deleted via C<hv_ename_add> and
553 C<hv_ename_delete>. These two functions are I<not> part of the API.
554
555 =item *
556
557 The way the parser handles labels has been cleaned up and refactored. As a
558 result, the C<newFOROP()> constructor function no longer takes a parameter
559 stating what label is to go in the state op.
560
561 =item *
562
563 The C<newWHILEOP()> and C<newFOROP()> functions no longer accept a line
564 number as a parameter.
565
566 =item *
567
568 A new C<parse_barestmt()> function has been added, for parsing a statement
569 without a label.
570
571 =item *
572
573 A new C<parse_label()> function has been added, that parses a statement
574 labels, separate from statements.
575
576 =item *
577
578 The C<CvSTASH()> macro can now only be used as an rvalue. C<CvSTASH_set()>
579 has been added to replace assignment to C<CvSTASH()>. This is to ensure
580 that backreferences are handled properly. These macros are not part of the
581 API.
582
583 =item *
584
585 The C<op_scope()> and C<op_lvalue()> functions have been added to the API,
586 but are considered experimental.
587
588 =back
589
590 =head1 Selected Bug Fixes
591
592 XXX Important bug fixes in the core language are summarised here.
593 Bug fixes in files in F<ext/> and F<lib/> are best summarised in
594 L</Modules and Pragmata>.
595
596 [ List each fix as a =item entry ]
597
598 =over 4
599
600 =item *
601
602 The C<parse_stmt> C function added in earlier in the 5.13.x series has been
603 fixed to work with statements ending with C<}>
604 L<[perl #78222]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78222>.
605
606 =item *
607
608 The C<parse_fullstmt> C function added in 5.13.5 has been fixed to work
609 when called while an expression is being parsed.
610
611 =item *
612
613 Characters in the Latin-1 non-ASCII range (0x80 to 0xFF) used not to match
614 themselves if the string happened to be UTF8-encoded internally, the
615 regular expression was not, and the character in the regular expression was
616 inside a repeated group (e.g.,
617 C<Encode::decode_utf8("\303\200") =~ /(\xc0)+/>)
618 L<[perl #78464]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78464>.
619
620 =item *
621
622 The C<(?d)> regular expression construct now overrides a previous C<(?u)>
623 or C<use feature "unicode_string">
624 L<[perl #78508]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78508>.
625
626 =item *
627
628 A memory leak in C<do "file">, introduced in perl 5.13.6, has been fixed
629 L<[perl #78488]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78488>.
630
631 =item *
632
633 Various bugs related to typeglob dereferencing have been fixed. See
634 L</Dereferencing typeglobs>, above.
635
636 =item *
637
638 The C<SvPVbyte> function available to XS modules now calls magic before
639 downgrading the SV, to avoid warnings about wide characters
640 L<[perl #72398]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=72398>.
641
642 =item *
643
644 The C<=> operator used to ignore magic (e.g., tie methods) on its
645 right-hand side if the scalar happened to hold a typeglob. This could
646 happen if a typeglob was the last thing returned from or assigned to a tied
647 scalar
648 L<[perl #77498]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77498>.
649
650 =item *
651
652 C<sprintf> was ignoring locales when called with constant arguments
653 L<[perl #78632]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78632>.
654
655 =item *
656
657 A non-ASCII character in the Latin-1 range could match both a Posix
658 class, such as C<[[:alnum:]]>, and its inverse C<[[:^alnum:]]>.  This is
659 now fixed for regular expressions compiled under the C<"u"> modifier.
660 See L</C<use feature "unicode_strings"> now applies to more regex matching>.
661 L<[perl #18281]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=18281>.
662
663 =item *
664
665 Concatenating long strings under C<use encoding> no longer causes perl to
666 crash
667 L<[perl #78674]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78674>.
668
669 =item *
670
671 Typeglob assignments would crash if the glob's stash no longer existed, if
672 the glob assigned to was named 'ISA' or the glob on either side of the
673 assignment contained a subroutine.
674
675 =item *
676
677 Calling C<< ->import >> on a class lacking an import method could corrupt the stack result in strange behaviour. For instance,
678
679   push @a, "foo", $b = bar->import;
680
681 would assign 'foo' to C<$b>
682 L<[perl #63790]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=63790>.
683
684 =item *
685
686 Creating an alias to a package when that package had been detached from the
687 symbol table would result in corrupted isa caches
688 L<[perl #77358]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77358>.
689
690 =item *
691
692 C<.=> followed by C<< <> >> or C<readline> would leak memory if C<$/>
693 contained characters beyond the octet range and the scalar assigned to
694 happened to be encoded as UTF8 internally
695 L<[perl #72246]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=72246>.
696
697 =item *
698
699 The C<recv> function could crash when called with the MSG_TRUNC flag
700 L<[perl #75082]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=75082>.
701
702 =back
703
704 =head1 Known Problems
705
706 XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
707 tests that had to be C<TODO>ed for the release would be noted here, unless
708 they were specific to a particular platform (see below).
709
710 This is a list of some significant unfixed bugs, which are regressions
711 from either 5.XXX.XXX or 5.XXX.XXX.
712
713 [ List each fix as a =item entry ]
714
715 =over 4
716
717 =item *
718
719 XXX
720
721 =back
722
723 =head1 Obituary
724
725 XXX If any significant core contributor has died, we've added a short obituary
726 here.
727
728 =head1 Acknowledgements
729
730 XXX The list of people to thank goes here.
731
732 =head1 Reporting Bugs
733
734 If you find what you think is a bug, you might check the articles
735 recently posted to the comp.lang.perl.misc newsgroup and the perl
736 bug database at http://rt.perl.org/perlbug/ .  There may also be
737 information at http://www.perl.org/ , the Perl Home Page.
738
739 If you believe you have an unreported bug, please run the B<perlbug>
740 program included with your release.  Be sure to trim your bug down
741 to a tiny but sufficient test case.  Your bug report, along with the
742 output of C<perl -V>, will be sent off to perlbug@perl.org to be
743 analysed by the Perl porting team.
744
745 If the bug you are reporting has security implications, which make it
746 inappropriate to send to a publicly archived mailing list, then please send
747 it to perl5-security-report@perl.org. This points to a closed subscription
748 unarchived mailing list, which includes all the core committers, who be able
749 to help assess the impact of issues, figure out a resolution, and help
750 co-ordinate the release of patches to mitigate or fix the problem across all
751 platforms on which Perl is supported. Please only use this address for
752 security issues in the Perl core, not for modules independently
753 distributed on CPAN.
754
755 =head1 SEE ALSO
756
757 The F<Changes> file for an explanation of how to view exhaustive details
758 on what changed.
759
760 The F<INSTALL> file for how to build Perl.
761
762 The F<README> file for general stuff.
763
764 The F<Artistic> and F<Copying> files for copyright information.
765
766 =cut