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