This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix Porting/cmpVERSION.pl to work on Win32
[perl5.git] / pod / perldelta.pod
... / ...
CommitLineData
1=encoding utf8
2
3=for release_engineer
4* changelogged up to 45a6a02
5
6=head1 NAME
7
8[ this is a template for a new perldelta file. Any text flagged as
9XXX needs to be processed before release. ]
10
11perldelta - what is new for perl v5.13.5
12
13=head1 DESCRIPTION
14
15This document describes differences between the 5.13.4 release and
16the 5.13.5 release.
17
18If you are upgrading from an earlier release such as 5.13.3, first read
19L<perl5134delta>, which describes differences between 5.13.3 and
205.13.4.
21
22=head1 Notice
23
24XXX Any important notices here
25
26=head1 Core Enhancements
27
28XXX New core language features go here. Summarise user-visible core language
29enhancements. Particularly prominent performance optimisations could go
30here, but most should go in the L</Performance Enhancements> section.
31
32=head2 Adjacent pairs of nextstate opcodes are now optimized away
33
34Previously, in code such as
35
36 use constant DEBUG => 0;
37
38 sub GAK {
39 warn if DEBUG;
40 print "stuff\n";
41 }
42
43the ops for C<warn if DEBUG;> would be folded to a C<null> op (C<ex-const>), but
44the C<nextstate> op would remain, resulting in a runtime op dispatch of
45C<nextstate>, C<nextstate>, ...
46
47The execution of a sequence of C<nexstate> ops is indistinguishable from just
48the last C<nextstate> op, so teach the peephole optimiser to eliminate the first
49of a pair of C<nextstate> ops. (Except where the first carries a label, as
50labels mustn't be eliminated by the optimiser, and label usage isn't
51conclusively known at compile time.)
52
53=head2 API function to parse statements
54
55The C<parse_fullstmt> function has been added to allow parsing of a single
56complete Perl statement. See L<perlapi> for details.
57
58=head2 API functions for accessing the runtime hinthash
59
60A new C API for introspecting the hinthash C<%^H> at runtime has been added. See
61C<cop_hints_2hv>, C<cop_hints_fetchpvn>, C<cop_hints_fetchpvs>,
62C<cop_hints_fetchsv>, and C<hv_copy_hints_hv> in L<perlapi> for details.
63
64=head2 C interface to C<caller()>
65
66The C<caller_cx> function has been added as an XSUB-writer's equivalent of
67C<caller()>. See L<perlapi> for details.
68
69=head1 Security
70
71XXX Any security-related notices go here. In particular, any security
72vulnerabilities closed should be noted here rather than in the
73L</Selected Bug Fixes> section.
74
75[ List each security issue as a =head2 entry ]
76
77=head1 Incompatible Changes
78
79=head2 Magic Variables Outside the Main Package
80
81In previous versions of perl, magic variables like C<$!>, C<%SIG>, etc. would
82'leak' into other packages. So C<%foo::SIG> could be used to access signals,
83C<${"foo::!"}> (with strict mode off) to access C's C<errno>, etc.
84
85This was a bug, or an 'unintentional' feature, which caused various ill
86effects, such as signal handlers being wiped when modules were loaded, etc.
87
88This has been fixed (or the feature has been removed, depending on how you
89see it).
90
91=head2 Smart-matching against array slices
92
93Previously, the following code resulted in a successful match:
94
95 my @a = qw(a y0 z);
96 my @b = qw(a x0 z);
97 $a[0 .. $#b] ~~ @b;
98
99This odd behaviour has now been fixed
100L<[perl #77468]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=77468>.
101
102=head2 C API changes
103
104The first argument of the C API function C<Perl_fetch_cop_label> has changed
105from C<struct refcounted he *> to C<COP *>, to better insulate the user from
106implementation details.
107
108This API function was marked as "may change", and likely isn't in use outside
109the core. (Neither an unpacked CPAN, nor Google's codesearch, finds any other
110references to it.)
111
112=head1 Deprecations
113
114XXX Any deprecated features, syntax, modules etc. should be listed here.
115In particular, deprecated modules should be listed here even if they are
116listed as an updated module in the L</Modules and Pragmata> section.
117
118=head2 Use of qw(...) as parentheses
119
120Historically the parser fooled itself into thinking that C<qw(...)> literals
121were always enclosed in parentheses, and as a result you could sometimes omit
122parentheses around them:
123
124 for $x qw(a b c) { ... }
125
126The parser no longer lies to itself in this way. Wrap the list literal in
127parentheses, like:
128
129 for $x (qw(a b c)) { ... }
130
131=head1 Performance Enhancements
132
133XXX Changes which enhance performance without changing behaviour go here. There
134may well be none in a stable release.
135
136[ List each enhancement as a =item entry ]
137
138=over 4
139
140=item *
141
142Scalars containing regular expressions now only allocate the part of the C<SV>
143body they actually use, saving some space.
144
145=item *
146
147Compiling regular expressions has been made faster for the case where upgrading
148the regex to utf8 is necessary, but that isn't known when the compilation
149begins.
150
151=back
152
153=head1 Modules and Pragmata
154
155XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
156go here. If Module::CoreList is updated, generate an initial draft of the
157following sections using F<Porting/corelist-perldelta.pl>, which prints stub
158entries to STDOUT. Results can be pasted in place of the '=head2' entries
159below. A paragraph summary for important changes should then be added by hand.
160In an ideal world, dual-life modules would have a F<Changes> file that could be
161cribbed.
162
163[ Within each section, list entries as a =item entry ]
164
165=head2 New Modules and Pragmata
166
167=over 4
168
169=item *
170
171XXX
172
173=back
174
175=head2 Updated Modules and Pragmata
176
177=over 4
178
179=item *
180
181C<blib> has been upgraded from version 1.05 to 1.06.
182
183=item *
184
185C<bignum>, C<bigint>, and C<bigrat> have been upgraded from version 0.23 to
1860.25.
187
188=item *
189
190C<open> has been upgraded from version 1.07 to 1.08.
191
192=item *
193
194C<warnings> has been upgraded from version 1.10 to 1.11.
195
196C<warnings::register> has been upgraded from version 1.01 to 1.02.
197
198It is now possible to register warning categories other than the names of
199packages using C<warnings::register>. See L<perllexwarn> for more information.
200
201=item *
202
203C<B::Debug> has been upgraded from version 1.12 to 1.16.
204
205=item *
206
207C<Data::Dumper> has been upgraded from version 2.126 to 2.128.
208
209This fixes a crash when using custom sort functions that might cause the stack
210to change.
211
212=item *
213
214C<Encode> has been upgraded from version 2.39 to 2.40.
215
216=item *
217
218C<Errno> has been upgraded from version 1.12 to 1.13.
219
220On some platforms with unusual header files, like Win32/gcc using mingw64
221headers, some constants which weren't actually error numbers have been exposed
222by C<Errno>. This has been fixed
223L<[perl #77416]|http://rt.perl.org/rt3//Public/Bug/Display.html?id=77416>.
224
225=item *
226
227C<ExtUtils::MakeMaker> has been upgraded from version 6.56 to 6.57_05.
228
229=item *
230
231C<Filter::Simple> has been upgraded from version 0.84 to 0.85.
232
233=item *
234
235C<Hash::Util> has been upgraded from version 0.08 to 0.09.
236
237=item *
238
239C<Math::BigInt> has been upgraded from version 1.89_01 to 1.95.
240C<Math::BigInt::Calc> has been upgraded from version 0.52 to 0.54.
241
242This fixes, among other things, incorrect results when computing binomial
243coefficients
244L<[perl #77640]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77640>.
245
246=item *
247
248C<Math::BigInt::FastCalc> has been upgraded from version 0.19 to 0.22.
249
250=item *
251
252C<Math::BigRat> has been upgraded from version 0.24 to 0.26.
253
254=item *
255
256C<Module::CoreList> has been upgraded from version 2.37 to 2.38.
257
258=item *
259
260C<POSIX> has been upgraded from version 1.19 to 1.20.
261
262It now includes constants for POSIX signal constants.
263
264=item *
265
266C<Safe> has been upgraded from version 2.27 to 2.28.
267
268This fixes a possible infinite loop when looking for coderefs.
269
270=item *
271
272C<Tie::Hash> has been upgraded from version 1.03 to 1.04.
273
274Calling C<< Tie::Hash->TIEHASH() >> used to loop forever. Now it C<croak>s.
275
276=item *
277
278C<Unicode::Collate> has been upgraded from version 0.56 to 0.59.
279
280=item *
281
282C<XSLoader> has been upgraded from version 0.10 to 0.11.
283
284=back
285
286=head2 Removed Modules and Pragmata
287
288=over 4
289
290=item *
291
292XXX
293
294=back
295
296=head1 Documentation
297
298XXX Changes to files in F<pod/> go here. Consider grouping entries by
299file and be sure to link to the appropriate page, e.g. L<perlfunc>.
300
301=head2 New Documentation
302
303XXX Changes which create B<new> files in F<pod/> go here.
304
305=head3 L<XXX>
306
307XXX Description of the purpose of the new file here
308
309=head2 Changes to Existing Documentation
310
311XXX Changes which significantly change existing files in F<pod/> go here.
312However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
313section.
314
315=head3 L<perlapi>
316
317=over 4
318
319=item *
320
321Many of the optree construction functions are now documented.
322
323=back
324
325=head3 L<perlfaq>
326
327L<perlfaq>, L<perlfaq2>, L<perlfaq4>, L<perlfaq5>, L<perlfaq6>, L<perlfaq8>, and
328L<perlfaq9> have seen various updates and modernisations.
329
330=head1 Diagnostics
331
332The following additions or changes have been made to diagnostic output,
333including warnings and fatal error messages. For the complete list of
334diagnostic messages, see L<perldiag>.
335
336XXX New or changed warnings emitted by the core's C<C> code go here. Also
337include any changes in L<perldiag> that reconcile it to the C<C> code.
338
339[ Within each section, list entries as a =item entry ]
340
341=head2 New Diagnostics
342
343XXX Newly added diagnostic messages go here
344
345=over 4
346
347=item *
348
349Use of qw(...) as parentheses is deprecated
350
351See L</"Use of qw(...) as parentheses"> for details.
352
353=back
354
355=head2 Changes to Existing Diagnostics
356
357XXX Changes (i.e. rewording) of diagnostic messages go here
358
359=over 4
360
361=item *
362
363XXX
364
365=back
366
367=head1 Utility Changes
368
369XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go
370here. Most of these are built within the directories F<utils> and F<x2p>.
371
372[ List utility changes as a =head3 entry for each utility and =item
373entries for each change
374Use L<XXX> with program names to get proper documentation linking. ]
375
376=head3 L<h2ph>
377
378=over 4
379
380=item *
381
382The use of a deprecated C<goto> construct has been removed
383L<[perl #74404]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=74404>.
384
385=back
386
387=head1 Configuration and Compilation
388
389XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
390go here. Any other changes to the Perl build process should be listed here.
391However, any platform-specific changes should be listed in the
392L</Platform Support> section, instead.
393
394[ List changes as a =item entry ].
395
396=over 4
397
398=item *
399
400XXX
401
402=back
403
404=head1 Testing
405
406XXX Any significant changes to the testing of a freshly built perl should be
407listed here. Changes which create B<new> files in F<t/> go here as do any
408large changes to the testing harness (e.g. when parallel testing was added).
409Changes to existing files in F<t/> aren't worth summarising, although the bugs
410that they represent may be covered elsewhere.
411
412[ List each test improvement as a =item entry ]
413
414=over 4
415
416=item *
417
418A rare race condition in F<t/op/while_readdir.t> has been fixed, stopping it
419from failing randomly when running tests in parallel.
420
421=item *
422
423The new F<t/op/leaky-magic.t> script tests that magic applied to variables in
424the main packages does not affect other packages.
425
426=back
427
428=head1 Platform Support
429
430XXX Any changes to platform support should be listed in the sections below.
431
432[ Within the sections, list each platform as a =item entry with specific
433changes as paragraphs below it. ]
434
435=head2 New Platforms
436
437XXX List any platforms that this version of perl compiles on, that previous
438versions did not. These will either be enabled by new files in the F<hints/>
439directories, or new subdirectories and F<README> files at the top level of the
440source tree.
441
442=over 4
443
444=item XXX-some-platform
445
446XXX
447
448=back
449
450=head2 Discontinued Platforms
451
452XXX List any platforms that this version of perl no longer compiles on.
453
454=over 4
455
456=item XXX-some-platform
457
458XXX
459
460=back
461
462=head2 Platform-Specific Notes
463
464XXX List any changes for specific platforms. This could include configuration
465and compilation changes or changes in portability/compatibility. However,
466changes within modules for platforms should generally be listed in the
467L</Modules and Pragmata> section.
468
469=over 4
470
471=item VMS
472
473=over 4
474
475=item *
476
477Make PerlIOUnix_open honour default permissions on VMS.
478
479When C<perlio> became the default and C<unixio> became the default bottom layer,
480the most common path for creating files from Perl became C<PerlIOUnix_open>,
481which has always explicitly used C<0666> as the permission mask.
482
483To avoid this, C<0777> is now passed as the permissions to C<open()>. In the VMS
484CRTL, C<0777> has a special meaning over and above intersecting with the current
485umask; specifically, it allows Unix syscalls to preserve native default
486permissions.
487
488=back
489
490=back
491
492=head1 Internal Changes
493
494XXX Changes which affect the interface available to C<XS> code go here.
495Other significant internal changes for future core maintainers should
496be noted as well.
497
498[ List each test improvement as a =item entry ]
499
500=over 4
501
502=item *
503
504C<CALL_FPTR> and C<CPERLscope> have been deprecated.
505
506Those are left from an old implementation of C<MULTIPLICITY> using C++ objects,
507which has been removed in 5.8. Nowadays these macros do exactly nothing, so they
508shouldn't be used anymore.
509
510For compatibility, they are still defined for external C<XS> code. Only
511extensions defining C<PERL_CORE> must be updated now.
512
513=item *
514
515C<lex_stuff_pvs()> has been added as a convenience macro wrapping
516C<lex_stuff_pvn()> for literal strings.
517
518=item *
519
520The recursive part of the peephole optimizer is how hookable.
521
522In addition to C<PL_peepp>, for hooking into the toplevel peephole optimizer, a
523C<PL_rpeepp> is now available to hook into the optimizer recursing into
524side-chains of the optree.
525
526=back
527
528=head1 Selected Bug Fixes
529
530XXX Important bug fixes in the core language are summarised here.
531Bug fixes in files in F<ext/> and F<lib/> are best summarised in
532L</Modules and Pragmata>.
533
534[ List each fix as a =item entry ]
535
536=over 4
537
538=item *
539
540A regression introduced in perl 5.12.0, making
541C<< my $x = 3; $x = length(undef) >> result in C<$x> set to C<3> has been
542fixed. C<$x> will now be C<undef>.
543
544=item *
545
546A fatal error in regular expressions when processing UTF-8 data has been fixed
547L<[perl #75680]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=75680>.
548
549=item *
550
551An erroneous regular expression engine optimization, that caused regex verbs
552like C<*COMMIT> to sometimes be ignored, has been removed.
553
554=item *
555
556The perl debugger now also works in taint mode
557L<[perl #76872]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=76872>.
558
559=item *
560
561Several memory leaks in cloning and freeing threaded perl interpreters have been
562fixed L<[perl #77352]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77352>.
563
564=item *
565
566A possible string corruption when doing regular expression matches on overloaded
567objects has been fixed
568L<[perl #77084]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77084>.
569
570=item *
571
572Magic applied to variables in the main package no longer affects other
573packages. See L</Magic Variables Outside the Main Package>, above
574L<[perl #76138]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=76138>.
575
576=item *
577
578Opening a glob reference via C<< open $fh, ">", \*glob >> will no longer cause
579the glob to be corrupted when the file handle is printed to. This would cause
580perl to crash whenever the glob's contents were accessed
581L<[perl #77492]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77492>.
582
583=item *
584
585The postincrement and postdecrement operators, C<++> and C<--> used to cause
586leaks when being used on references. This has now been fixed.
587
588=item *
589
590A bug when replacing the glob of a loop variable within the loop has been fixed
591L<[perl #21469]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=21469>. This
592means the following code will no longer crash:
593
594 for $x (...) {
595 *x = *y;
596 }
597
598=item *
599
600Perl would segfault if the undocumented C<Internals> functions that
601used reference prototypes were called with the C<&foo()> syntax,
602e.g. C<&Internals::SvREADONLY(undef)>
603L<[perl #77776]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77776>.
604
605These functions now call C<SvROK> on their arguments before
606dereferencing them with C<SvRV>, and we test for this case in
607F<t/lib/universal.t>.
608
609=item *
610
611When assigning a list with duplicated keys to a hash, the assignment used to
612return garbage and/or freed values:
613
614 @a = %h = (list with some duplicate keys);
615
616This has now been fixed [perl #31865].
617
618=item *
619
620An earlier release of the 5.13 series of perl changed the semantics of opening a
621reference to a copy of a glob:
622
623 my $var = *STDOUT;
624 open my $fh, '>', \$var;
625
626This was a mistake, and the previous behaviour from perl 5.10 and 5.12, which is
627to treat \$var as a scalar reference, has now been restored.
628
629=item *
630
631The regular expression bracketed character class C<[\8\9]> was
632effectively the same as C<[89\000]>, incorrectly matching a NULL character.
633It also gave incorrect warnings that the C<8> and C<9> were ignored.
634Now C<[\8\9]> is the same as C<[89]> and gives legitimate warnings that
635C<\8> and C<\9> are unrecognized escape sequences, passed-through.
636
637=item *
638
639C<warn()> now respects utf8-encoded scalars
640L<[perl #45549]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=45549>.
641
642=back
643
644=head1 Known Problems
645
646XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
647tests that had to be C<TODO>ed for the release would be noted here, unless
648they were specific to a particular platform (see below).
649
650This is a list of some significant unfixed bugs, which are regressions
651from either 5.XXX.XXX or 5.XXX.XXX.
652
653[ List each fix as a =item entry ]
654
655=over 4
656
657=item *
658
659XXX
660
661=back
662
663=head1 Obituary
664
665XXX If any significant core contributor has died, we've added a short obituary
666here.
667
668=head1 Acknowledgements
669
670XXX The list of people to thank goes here.
671
672=head1 Reporting Bugs
673
674If you find what you think is a bug, you might check the articles
675recently posted to the comp.lang.perl.misc newsgroup and the perl
676bug database at http://rt.perl.org/perlbug/ . There may also be
677information at http://www.perl.org/ , the Perl Home Page.
678
679If you believe you have an unreported bug, please run the B<perlbug>
680program included with your release. Be sure to trim your bug down
681to a tiny but sufficient test case. Your bug report, along with the
682output of C<perl -V>, will be sent off to perlbug@perl.org to be
683analysed by the Perl porting team.
684
685If the bug you are reporting has security implications, which make it
686inappropriate to send to a publicly archived mailing list, then please send
687it to perl5-security-report@perl.org. This points to a closed subscription
688unarchived mailing list, which includes all the core committers, who be able
689to help assess the impact of issues, figure out a resolution, and help
690co-ordinate the release of patches to mitigate or fix the problem across all
691platforms on which Perl is supported. Please only use this address for
692security issues in the Perl core, not for modules independently
693distributed on CPAN.
694
695=head1 SEE ALSO
696
697The F<Changes> file for an explanation of how to view exhaustive details
698on what changed.
699
700The F<INSTALL> file for how to build Perl.
701
702The F<README> file for general stuff.
703
704The F<Artistic> and F<Copying> files for copyright information.
705
706=cut