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