This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta for File::Spec->tmpdir and changing env (#88940)
[perl5.git] / pod / perldelta.pod
CommitLineData
44691e6f
AB
1=encoding utf8
2
3=head1 NAME
4
583aa5c2
RS
5[ this is a template for a new perldelta file. Any text flagged as XXX needs
6to be processed before release. ]
7
8perldelta - what is new for perl v5.19.1
e128ab2c 9
4eabcf70 10=head1 DESCRIPTION
6db9054f 11
583aa5c2 12This document describes differences between the 5.19.0 release and the 5.19.1
e08634c5 13release.
6db9054f 14
e9912eaa 15=head1 Notice
5ed58cbd 16
583aa5c2
RS
17XXX Any important notices here
18
19=head1 Core Enhancements
20
21XXX New core language features go here. Summarize user-visible core language
22enhancements. Particularly prominent performance optimisations could go
23here, but most should go in the L</Performance Enhancements> section.
24
25[ List each enhancement as a =head2 entry ]
26
27=head1 Security
28
29XXX Any security-related notices go here. In particular, any security
30vulnerabilities closed should be noted here rather than in the
31L</Selected Bug Fixes> section.
32
33[ List each security issue as a =head2 entry ]
34
35=head1 Incompatible Changes
36
37XXX For a release on a stable branch, this section aspires to be:
38
39 There are no changes intentionally incompatible with 5.XXX.XXX
40 If any exist, they are bugs, and we request that you submit a
41 report. See L</Reporting Bugs> below.
42
43[ List each incompatible change as a =head2 entry ]
44
45=head1 Deprecations
46
47XXX Any deprecated features, syntax, modules etc. should be listed here.
48
49=head2 Module removals
50
51XXX Remove this section if inapplicable.
52
53The following modules will be removed from the core distribution in a future
54release, and will at that time need to be installed from CPAN. Distributions
55on CPAN which require these modules will need to list them as prerequisites.
56
57The core versions of these modules will now issue C<"deprecated">-category
58warnings to alert you to this fact. To silence these deprecation warnings,
59install the modules in question from CPAN.
60
61Note that these are (with rare exceptions) fine modules that you are encouraged
62to continue to use. Their disinclusion from core primarily hinges on their
63necessity to bootstrapping a fully functional, CPAN-capable Perl installation,
64not usually on concerns over their design.
65
66XXX Note that deprecated modules should be listed here even if they are listed
67as an updated module in the L</Modules and Pragmata> section.
68
69=over
70
71=item *
72
1799399c
RS
73L<DB> has been updated from 1.05 to 1.06 and L<perl5db.pl> from 1.39_10
74to 1.40. The call depth allowed by default in the debugger is now 1000
75rather than 100.
583aa5c2
RS
76
77=back
78
79[ List each other deprecation as a =head2 entry ]
80
81=head1 Performance Enhancements
82
83XXX Changes which enhance performance without changing behaviour go here.
84There may well be none in a stable release.
85
86[ List each enhancement as a =item entry ]
87
88=over 4
89
90=item *
91
13b0f67d
DM
92Perl has a new copy-on-write mechanism that avoids the need to copy the
93internal string buffer when assigning from one scalar to another. This
94makes copying large strings appear much faster. Modifying one of the two
95(or more) strings after an assignment will force a copy internally. This
96makes it unnecessary to pass strings by reference for efficiency.
97
98This feature was already available in 5.18.0, but wasn't enabled by
99default. It is the default now, and so you no longer need build perl with
100the F<Configure> argument:
101
102 -Accflags=PERL_NEW_COPY_ON_WRITE
103
104It can be disabled (for now) in a perl build with:
105
106 -Accflags=PERL_NO_COW
583aa5c2
RS
107
108=back
5ed58cbd 109
e9912eaa 110=head1 Modules and Pragmata
5ed58cbd 111
583aa5c2
RS
112XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
113go here. If Module::CoreList is updated, generate an initial draft of the
114following sections using F<Porting/corelist-perldelta.pl>, which prints stub
115entries to STDOUT. Results can be pasted in place of the '=head2' entries
116below. A paragraph summary for important changes should then be added by hand.
117In an ideal world, dual-life modules would have a F<Changes> file that could be
118cribbed.
119
120[ Within each section, list entries as a =item entry ]
121
122=head2 New Modules and Pragmata
123
124=over 4
125
126=item *
127
128XXX
129
130=back
131
e9912eaa 132=head2 Updated Modules and Pragmata
5ed58cbd 133
e9912eaa 134=over 4
5ed58cbd 135
e9912eaa 136=item *
5ed58cbd 137
0597af6b
FC
138B::Deparse has been upgraded from version 1.20 to 1.21.
139
76ac7129 140C<foreach my $lexical> is now deparsed correctly with the B<-p> option.
0597af6b
FC
141[RT #117081]
142
4602962a
FC
143The B<-l> option no longer puts form feeds in the middle of a line when
144outputting C<map> and C<grep> blocks. [RT #117311]
145
708e0828
FC
146Elements of C<%#>, such as C<$# {foo}> and C<${#}{foo}> are now deparsed
147correctly. [RT #117531]
148
0597af6b
FC
149=item *
150
287d2d21
FC
151File::Spec has been upgraded from version 3.40 to 3.41.
152
153C<tmpdir> now respects changes to environment variables from which the
154temporary directory is derived. [RT #88940]
155
156=item *
157
dbd04185
NC
158Test::Harness has been upgraded from version 3.26 to 3.28
159
160Memory usage is dramatically reduced. t/harness now uses about 10% of the
161memory used by 3.26 and earlier.
162
163C<PERL5LIB> is always propagated to a test's C<@INC>, even under C<-T>.
583aa5c2 164
1fdd5e53
KW
165=item *
166
167Unicode::UCD has been upgraded from version 0.51 to 0.52.
168
169A function, L<Unicode::UCD/search_invlist()> is now available to do
170search an inversion list or map for a code point.
171
583aa5c2
RS
172=back
173
174=head2 Removed Modules and Pragmata
175
176=over 4
5ed58cbd 177
e9912eaa 178=item *
5ed58cbd 179
583aa5c2
RS
180XXX
181
182=back
183
184=head1 Documentation
185
186XXX Changes to files in F<pod/> go here. Consider grouping entries by
187file and be sure to link to the appropriate page, e.g. L<perlfunc>.
188
189=head2 New Documentation
190
191XXX Changes which create B<new> files in F<pod/> go here.
192
193=head3 L<XXX>
194
195XXX Description of the purpose of the new file here
196
197=head2 Changes to Existing Documentation
198
199XXX Changes which significantly change existing files in F<pod/> go here.
200However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
201section.
202
4990a62a 203=head3 L<perltrap>
583aa5c2
RS
204
205=over 4
1993add8 206
e9912eaa 207=item *
ec985017 208
4990a62a 209There is now a L<JavaScript|perltrap/JavaScript Traps> section.
583aa5c2
RS
210
211=back
212
213=head1 Diagnostics
214
215The following additions or changes have been made to diagnostic output,
216including warnings and fatal error messages. For the complete list of
217diagnostic messages, see L<perldiag>.
218
219XXX New or changed warnings emitted by the core's C<C> code go here. Also
220include any changes in L<perldiag> that reconcile it to the C<C> code.
221
222=head2 New Diagnostics
223
224XXX Newly added diagnostic messages go under here, separated into New Errors
225and New Warnings
226
227=head3 New Errors
228
229=over 4
71e6aba6
RS
230
231=item *
232
583aa5c2
RS
233XXX L<message|perldiag/"message">
234
235=back
236
237=head3 New Warnings
238
239=over 4
71e6aba6 240
d5f315e8
KW
241=item *
242
6f397ec1
FC
243L<A sequence of multiple spaces in a charnames alias definition is deprecated|perldiag/"A sequence of multiple spaces in a charnames alias definition is deprecated">
244
245L<Trailing white-space in a charnames alias definition is deprecated|perldiag/"Trailing white-space in a charnames alias definition is deprecated">
246
247These two deprecation warnings involving C<\N{...}> were incorrectly
248implemented. They did not warn by default (now they do) and could not be
249made fatal via C<use warnings FATAL => 'deprecated'> (now they can).
d5f315e8 250
337fb649 251=back
2426c394 252
583aa5c2 253=head2 Changes to Existing Diagnostics
e9912eaa 254
583aa5c2 255XXX Changes (i.e. rewording) of diagnostic messages go here
357b01df 256
583aa5c2 257=over 4
357b01df 258
583aa5c2 259=item *
357b01df 260
583aa5c2 261XXX Describe change here
357b01df 262
583aa5c2 263=back
357b01df 264
583aa5c2 265=head1 Utility Changes
357b01df 266
583aa5c2
RS
267XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go here.
268Most of these are built within the directories F<utils> and F<x2p>.
357b01df 269
583aa5c2
RS
270[ List utility changes as a =head3 entry for each utility and =item
271entries for each change
272Use L<XXX> with program names to get proper documentation linking. ]
357b01df 273
4724da03
NC
274=head3 F<bisect.pl> enhancements
275
276The git bisection tool F<Porting/bisect.pl> has had many enhancements.
357b01df 277
583aa5c2 278=over 4
357b01df 279
583aa5c2 280=item *
357b01df 281
4724da03
NC
282Can optionally run the test case with a timeout.
283
284=item *
285
286Can now run in-place in a clean git checkout.
287
288=item *
289
290Can run the test case under C<valgrind>.
291
292=item *
293
294Can apply user supplied patches and fixes to the source checkout before
295building.
296
297=item *
298
299Now has fixups to enable building several more historical ranges of bleadperl,
300which can be useful for pinpointing the origins of bugs or behaviour changes.
357b01df 301
583aa5c2
RS
302=back
303
4724da03
NC
304It is provided as part of the source distribution but not installed because
305it is not self-contained as it relies on being run from within a git
306checkout. Note also that it makes no attempt to fix tests, correct runtime
307bugs or make something useful to install - its purpose is to make minimal
308changes to get any historical revision of interest to build and run as close
309as possible to "as-was", and thereby make C<git bisect> easy to use.
310
583aa5c2
RS
311=head1 Configuration and Compilation
312
313XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
314go here. Any other changes to the Perl build process should be listed here.
315However, any platform-specific changes should be listed in the
316L</Platform Support> section, instead.
317
318[ List changes as a =item entry ].
319
320=over 4
321
322=item *
323
324XXX
357b01df 325
e9912eaa 326=back
357b01df 327
583aa5c2
RS
328=head1 Testing
329
330XXX Any significant changes to the testing of a freshly built perl should be
331listed here. Changes which create B<new> files in F<t/> go here as do any
332large changes to the testing harness (e.g. when parallel testing was added).
333Changes to existing files in F<t/> aren't worth summarizing, although the bugs
334that they represent may be covered elsewhere.
335
336[ List each test improvement as a =item entry ]
337
338=over 4
339
340=item *
341
342XXX
343
344=back
345
346=head1 Platform Support
347
348XXX Any changes to platform support should be listed in the sections below.
349
350[ Within the sections, list each platform as a =item entry with specific
351changes as paragraphs below it. ]
352
353=head2 New Platforms
354
355XXX List any platforms that this version of perl compiles on, that previous
356versions did not. These will either be enabled by new files in the F<hints/>
357directories, or new subdirectories and F<README> files at the top level of the
358source tree.
359
360=over 4
361
362=item XXX-some-platform
363
364XXX
365
366=back
367
368=head2 Discontinued Platforms
369
370XXX List any platforms that this version of perl no longer compiles on.
371
372=over 4
373
374=item XXX-some-platform
357b01df 375
583aa5c2 376XXX
5ed58cbd 377
583aa5c2
RS
378=back
379
380=head2 Platform-Specific Notes
381
382XXX List any changes for specific platforms. This could include configuration
383and compilation changes or changes in portability/compatibility. However,
384changes within modules for platforms should generally be listed in the
385L</Modules and Pragmata> section.
386
387=over 4
388
7df6ffa3 389=item Mixed-endian platforms
583aa5c2 390
7df6ffa3
NC
391The code supporting C<pack> and C<unpack> operations on mixed endian
392platforms has been removed. We believe that Perl has long been unable to
393build on mixed endian architectures (such as PDP-11s), so we don't think
394that this change will affect any platforms which are able to build v5.18.0.
583aa5c2
RS
395
396=back
397
398=head1 Internal Changes
399
400XXX Changes which affect the interface available to C<XS> code go here. Other
401significant internal changes for future core maintainers should be noted as
402well.
403
583aa5c2
RS
404=over 4
405
406=item *
407
13b0f67d
DM
408Perl's new copy-on-write mechanism (which is now enabled by default),
409allows any C<SvPOK> scalar to be automatically upgraded to a copy-on-write
410scalar when copied. A reference count on the string buffer is stored in
411the string buffer itself.
412
413For example:
414
415 $ perl -MDevel::Peek -e'$a="abc"; $b = $a; Dump $a; Dump $b'
416 SV = PV(0x260cd80) at 0x2620ad8
417 REFCNT = 1
418 FLAGS = (POK,IsCOW,pPOK)
419 PV = 0x2619bc0 "abc"\0
420 CUR = 3
421 LEN = 16
422 COW_REFCNT = 1
423 SV = PV(0x260ce30) at 0x2620b20
424 REFCNT = 1
425 FLAGS = (POK,IsCOW,pPOK)
426 PV = 0x2619bc0 "abc"\0
427 CUR = 3
428 LEN = 16
429 COW_REFCNT = 1
430
431Note that both scalars share the same PV buffer and have a COW_REFCNT
432greater than zero.
433
434This means that XS code which wishes to modify the C<SvPVX()> buffer of an
435SV should call C<SvPV_force()> or similar first, to ensure a valid (and
436unshared) buffer, and to call C<SvSETMAGIC()> afterwards. This in fact has
437always been the case (for example hash keys were already copy-on-write);
438this change just spreads the COW behaviour to a wider variety of SVs.
439
440One important difference is that before 5.18.0, shared hash-key scalars
441used to have the C<SvREADONLY> flag set; this is no longer the case.
442
443This new behaviour can still be disabled by running F<Configure> with
444B<-Accflags=-DPERL_NO_COW>. This option will probably be removed in Perl
4455.22.
446
447=item *
448
449C<PL_sawampersand> is now a constant. The switch this variable provided
450(to enable/disable the pre-match copy depending on whether C<$&> had been
451seen) has been removed and replaced with copy-on-write, eliminating a few
452bugs.
453
454The previous behaviour can still be enabled by running F<Configure> with
455B<-Accflags=-DPERL_SAWAMPERSAND>.
456
457=item *
458
7df6ffa3
NC
459The functions C<my_swap>, C<my_htonl> and C<my_ntohl> have been removed.
460It is unclear why these functions were ever marked as I<A>, part of the
461API. XS code can't call them directly, as it can't rely on them being
462compiled. Unsurprisingly, no code on CPAN references them.
583aa5c2 463
bb240f8d
DM
464=item *
465
466The signature of the C<Perl_re_intuit_start()> regex function has changed;
467the function pointer C<intuit> in the regex engine plugin structure
468has also changed accordingly. A new parameter, C<strbeg> has been added;
469this has the same meaning as the same-named parameter in
470C<Perl_regexec_flags>. Previously intuit would try to guess the start of
471the string from the passed SV (if any), and would sometimes get it wrong
472(e.g. with an overloaded SV).
473
583aa5c2
RS
474=back
475
476=head1 Selected Bug Fixes
477
478XXX Important bug fixes in the core language are summarized here. Bug fixes in
479files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>.
5ed58cbd 480
583aa5c2 481[ List each fix as a =item entry ]
32b79602 482
583aa5c2
RS
483=over 4
484
485=item *
486
c2a50ddb
NC
487The OP allocation code now returns correctly aligned memory in all cases
488for C<struct pmop>. Previously it could return memory only aligned to a
4894-byte boundary, which is not correct for an ithreads build with 64 bit IVs
490on some 32 bit platforms. Notably, this caused the build to fail completely
491on sparc GNU/Linux. [RT #118055]
583aa5c2 492
b019bbd2
NC
493=item *
494
495The debugger's C<man> command been fixed. It was broken in the v5.18.0
496release. The C<man> command is aliased to the names C<doc> and C<perldoc> -
497all now work again.
498
9faf471a
NC
499=item *
500
501Evaluating large hashes in scalar context is now much faster, as the number
502of used chains in the hash is now cached for larger hashes. Smaller hashes
503continue not to store it and calculate it when needed, as this saves one IV.
504That would be 1 IV overhead for every object built from a hash. [RT #114576]
505
46f1e811
TC
506=item *
507
bccd8210 508Fixed a small number of regexp constructions that could either fail to
46f1e811
TC
509match or crash perl when the string being matched against was
510allocated above the 2GB line on 32-bit systems. [RT #118175]
511
dc6876f2
FC
512=item *
513
514Perl v5.16 inadvertently introduced a bug whereby calls to XSUBs that were
515not visible at compile time were treated as lvalues and could be assigned
516to, even when the subroutine was not an lvalue sub. This has been fixed.
517[RT #117947]
518
94f72172
FC
519=item *
520
521In Perl v5.18.0 dualvars that had an empty string for the string part but a
522non-zero number for the number part starting being treated as true. In
523previous versions they were treated as false, the string representation
524taking precedeence. The old behaviour has been restored. [RT #118159]
525
c3839c10
FC
526=item *
527
528Since Perl v5.12, inlining of constants that override built-in keywords of
529the same name had countermanded C<use subs>, causing subsequent mentions of
530the constant to use the built-in keyword instead. This has been fixed.
531
81748522
FC
532=item *
533
534Lexical constants (C<my sub a() { 42 }>) no longer crash when inlined.
535
536=item *
537
538Parameter prototypes attached to lexical subroutines are now respected when
539compiling sub calls without parentheses. Previously, the prototypes were
540honoured only for calls I<with> parentheses. [RT #116735]
541
3221bc40
FC
542=item *
543
544Syntax errors in lexical subroutines in combination with calls to the same
545subroutines no longer cause crashes at compile time.
546
2a288271
FC
547=item *
548
549The warning produced by C<-l $handle> now applies to IO refs and globs, not
550just to glob refs. That warning is also now UTF8-clean. [RT #117595]
551
5f050f83
FC
552=item *
553
554Various memory leaks involving the parsing of the C<(?[...])> regular
555expression construct have been fixed.
556
557=item *
558
559C<(?[...])> now allows interpolation of precompiled patterns consisting of
560(?[...])> with bracket character classes inside (C<$pat =
561S<qr/(?[ [a] ])/;> S</(?[ $pat ])/>>). Formerly, the brackets would
562confuse the regular expression parser.
563
a2ef523e
FC
564=item *
565
566C<delete local $ENV{nonexistent_env_var}> no longer leaks memory.
567
1efc2d08
FC
568=item *
569
570C<sort> and C<require> followed by a keyword prefixed with C<CORE::> now
571treat it as a keyword, and not as a subroutine or module name. [RT #24482]
572
42dd67ca
FC
573=item *
574
575Through certain conundrums, it is possible to cause the current package to
576be freed. Certain operators (C<bless>, C<reset>, C<open>, C<eval>) could
577not cope and would crash. They have been made more resilient. [RT #117941]
578
e0d46238
FC
579=item *
580
581Aliasing filehandles through glob-to-glob assignment would not update
582internal method caches properly if a package of the same name as the
583filehandle existed, resulting in filehandle method calls going to the
584package instead. This has been fixed.
585
583aa5c2
RS
586=back
587
588=head1 Known Problems
589
590XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
591tests that had to be C<TODO>ed for the release would be noted here. Unfixed
592platform specific bugs also go here.
593
594[ List each fix as a =item entry ]
595
596=over 4
597
598=item *
599
600XXX
601
602=back
603
604=head1 Obituary
605
606XXX If any significant core contributor has died, we've added a short obituary
607here.
608
609=head1 Acknowledgements
a75569c0 610
583aa5c2 611XXX Generate this with:
e9912eaa 612
583aa5c2 613 perl Porting/acknowledgements.pl v5.19.1..HEAD
f5b73711 614
44691e6f
AB
615=head1 Reporting Bugs
616
e08634c5
SH
617If you find what you think is a bug, you might check the articles recently
618posted to the comp.lang.perl.misc newsgroup and the perl bug database at
619http://rt.perl.org/perlbug/ . There may also be information at
620http://www.perl.org/ , the Perl Home Page.
44691e6f 621
e08634c5
SH
622If you believe you have an unreported bug, please run the L<perlbug> program
623included with your release. Be sure to trim your bug down to a tiny but
624sufficient test case. Your bug report, along with the output of C<perl -V>,
625will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
44691e6f
AB
626
627If the bug you are reporting has security implications, which make it
e08634c5
SH
628inappropriate to send to a publicly archived mailing list, then please send it
629to perl5-security-report@perl.org. This points to a closed subscription
630unarchived mailing list, which includes all the core committers, who will be
631able to help assess the impact of issues, figure out a resolution, and help
f9001595 632co-ordinate the release of patches to mitigate or fix the problem across all
e08634c5
SH
633platforms on which Perl is supported. Please only use this address for
634security issues in the Perl core, not for modules independently distributed on
635CPAN.
44691e6f
AB
636
637=head1 SEE ALSO
638
e08634c5
SH
639The F<Changes> file for an explanation of how to view exhaustive details on
640what changed.
44691e6f
AB
641
642The F<INSTALL> file for how to build Perl.
643
644The F<README> file for general stuff.
645
646The F<Artistic> and F<Copying> files for copyright information.
647
648=cut