This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[Merge] [perl #113930] Lexical subs
[perl5.git] / pod / perldelta.pod
CommitLineData
44691e6f
AB
1=encoding utf8
2
3=head1 NAME
4
916c45d9
SH
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.17.4
e128ab2c 9
4eabcf70 10=head1 DESCRIPTION
6db9054f 11
916c45d9 12This document describes differences between the 5.17.3 release and the 5.17.4
e08634c5 13release.
6db9054f 14
916c45d9
SH
15If you are upgrading from an earlier release such as 5.17.2, first read
16L<perl5173delta>, which describes differences between 5.17.2 and 5.17.3.
9c5f5e7a 17
916c45d9 18=head1 Notice
afae8808 19
916c45d9 20XXX Any important notices here
afae8808 21
916c45d9 22=head1 Core Enhancements
9c5f5e7a 23
916c45d9
SH
24XXX New core language features go here. Summarize user-visible core language
25enhancements. Particularly prominent performance optimisations could go
26here, but most should go in the L</Performance Enhancements> section.
9c5f5e7a 27
916c45d9 28[ List each enhancement as a =head2 entry ]
9c5f5e7a 29
83d881f0
KW
30=head2 Latest Unicode 6.2 beta is included
31
32This is supposed to be the final data for 6.2, unless glitches are
33found. The earlier experimental 6.2 beta data has been reverted, and
34this used instead. Not all the changes that were proposed for 6.2 and
35that were in the earlier beta versions are actually going into 6.2. In
36particular, there are no changes from 6.1 in the General_Category of any
37characters. 6.2 does revise the C<\X> handling for the REGIONAL
38INDICATOR characters that were added in Unicode 6.0. Perl now for the
39first time fully handles this revision.
40
5faa50e9
FR
41=head2 New DTrace probes
42
43The following new DTrace probes have been added:
44
45=over 4
46
47=item C<op-entry>
48
49=item C<loading-file>
50
51=item C<loaded-file>
52
53=back
54
916c45d9 55=head1 Security
9c5f5e7a 56
916c45d9
SH
57XXX Any security-related notices go here. In particular, any security
58vulnerabilities closed should be noted here rather than in the
59L</Selected Bug Fixes> section.
9c5f5e7a 60
916c45d9 61[ List each security issue as a =head2 entry ]
9c5f5e7a 62
916c45d9 63=head1 Incompatible Changes
9c5f5e7a 64
916c45d9 65XXX For a release on a stable branch, this section aspires to be:
9c5f5e7a 66
916c45d9
SH
67 There are no changes intentionally incompatible with 5.XXX.XXX
68 If any exist, they are bugs, and we request that you submit a
69 report. See L</Reporting Bugs> below.
9c5f5e7a 70
916c45d9 71[ List each incompatible change as a =head2 entry ]
9c5f5e7a 72
916c45d9 73=head1 Deprecations
9c5f5e7a 74
916c45d9
SH
75XXX Any deprecated features, syntax, modules etc. should be listed here. In
76particular, deprecated modules should be listed here even if they are listed as
77an updated module in the L</Modules and Pragmata> section.
9c5f5e7a 78
916c45d9 79[ List each deprecation as a =head2 entry ]
9c5f5e7a 80
916c45d9 81=head1 Performance Enhancements
9c5f5e7a 82
916c45d9
SH
83XXX Changes which enhance performance without changing behaviour go here.
84There may well be none in a stable release.
ed2b0264 85
916c45d9 86[ List each enhancement as a =item entry ]
ed2b0264 87
916c45d9 88=over 4
338a1057
SH
89
90=item *
91
a3d51778
KW
92Speed up in regular expression matching against Unicode properties. The
93largest gain is for C<\X>, the Unicode "extended grapheme cluster". The
94gain for it is about 35% - 40%. Bracketed character classes, e.g.,
95C<[0-9\x{100}]> containing code points above 255 are also now faster.
0ace302a 96
5faa50e9
FR
97=item *
98
99On platforms supporting it, several former macros are now implemented as static
100inline functions. This should speed things up slightly on non-GCC platforms.
101
102=item *
103
104Apply the optimisation of hashes in boolean context, such as in C<if> or C<and>,
105to constructs in non-void context.
106
107=item *
108
109Extend the optimisation of hashes in boolean context to C<scalar(%hash)>,
110C<%hash ? ... : ...>, and C<sub { %hash || ... | }>.
111
112=item *
113
114When making a copy of the string being matched against (so that $1, $& et al
115continue to show the correct value even if the original string is subsequently
116modified), only copy that substring of the original string needed for the
117capture variables, rather than copying the whole string.
118
119This is a big win for code like
120
121 $&;
122 $_ = 'x' x 1_000_000;
123 1 while /(.)/;
124
125Also, when pessimizing if the code contains C<$`>, C<$&> or C<$'>, record the
126presence of each variable separately, so that the determination of the substring
127range is based on each variable separately. So performance-wise,
128
129 $&; /x/
130
131is now roughly equivalent to
132
133 /(x)/
134
135whereas previously it was like
136
137 /^(.*)(x)(.*)$/
138
139and
140
141 $&; $'; /x/
142
143is now roughly equivalent to
144
145 /(x)(.*)$/
146
147etc.
148
916c45d9 149=back
0ace302a 150
916c45d9 151=head1 Modules and Pragmata
9c5f5e7a 152
916c45d9
SH
153XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
154go here. If Module::CoreList is updated, generate an initial draft of the
155following sections using F<Porting/corelist-perldelta.pl>, which prints stub
156entries to STDOUT. Results can be pasted in place of the '=head2' entries
157below. A paragraph summary for important changes should then be added by hand.
158In an ideal world, dual-life modules would have a F<Changes> file that could be
159cribbed.
9c5f5e7a 160
916c45d9 161[ Within each section, list entries as a =item entry ]
d4ada64a 162
916c45d9 163=head2 New Modules and Pragmata
d4ada64a 164
916c45d9 165=over 4
63870e6d 166
930a023a
SM
167=item *
168
916c45d9 169XXX
33f804f6 170
916c45d9 171=back
4cc02608 172
916c45d9 173=head2 Updated Modules and Pragmata
4cc02608 174
916c45d9 175=over 4
e7b92d54
SH
176
177=item *
178
5faa50e9
FR
179L<Archive::Tar> has been upgraded from version 1.88 to 1.90. This adds
180documentation fixes.
181
182=item *
183
184L<B> has been upgraded from version 1.37 to 1.38. This makes the module work
185with the new pad API.
186
187=item *
188
189L<B::Concise> has been upgraded from version 0.92 to 0.93. This adds support
190for the new C<OpMAYBE_TRUEBOOL> and C<OPpTRUEBOOL> flags.
191
192=item *
193
194L<B::Deparse> has been upgraded from version 1.16 to 1.17. This suppresses
195trailing semicolons in formats.
196
197=item *
198
2a527d37
SH
199L<DB_File> has been upgraded from version 1.826 to 1.827. The main Perl module
200no longer uses the C<"@_"> construct.
201
202=item *
203
5faa50e9
FR
204L<Devel::Peek> has been upgraded from version 1.09 to 1.10. This fixes
205compilation with C++ compilers and makes the module work with the new pad API.
206
207=item *
208
209L<DynaLoader> has been upgraded from version 1.15 to 1.16. This fixes warnings
210about using C<CODE> sections without an C<OUTPUT> section.
211
212=item *
213
214L<ExtUtils::ParseXS> has been upgraded from version 3.17 to 3.18. This avoids a
215bogus warning for initialised XSUB non-parameters.
216
217=item *
218
846de5c9
SH
219L<File::Copy> has been upgraded from version 2.23 to 2.24. C<copy()> no longer
220zeros files when copying into the same directory, and also now fails (as it has
221long been documented to do) when attempting to copy a file over itself.
222
223=item *
224
5faa50e9
FR
225L<File::Find> has been upgraded from version 1.21 to 1.22. This fixes
226inconsistent unixy path handling on VMS.
227
228=item *
229
5f877a7f
SH
230L<IPC::Open3> has been upgraded from version 1.12 to 1.13. The C<open3()>
231function no longer uses C<POSIX::close()> to close file descriptors since that
232breaks the ref-counting of file descriptors done by PerlIO in cases where the
233file descriptors are shared by PerlIO streams, leading to attempts to close the
234file descriptors a second time when any such PerlIO streams are closed later on.
235
236=item *
237
2a527d37
SH
238L<Locale::Codes> has been upgraded from version 3.22 to 3.23. It includes some
239new codes.
240
241=item *
242
5faa50e9
FR
243L<Module::CoreList> has been upgraded from version 2.71 to 2.73. This restores
244compatibility with older versions of perl and cleans up the corelist data for
245various modules.
246
247=item *
248
249L<Opcode> has been upgraded from version 1.23 to 1.24 to reflect the removal of
250the boolkeys opcode.
251
252=item *
253
aff163d9
SH
254L<Socket> has been upgraded from version 2.004 to 2.006.
255C<unpack_sockaddr_in()> and C<unpack_sockaddr_in6()> now return just the IP
256address in scalar context, and C<inet_ntop()> now guards against incorrect
257length scalars being passed in.
9c5f5e7a 258
5faa50e9
FR
259=item *
260
eebee32b
FR
261L<Storable> has been upgraded from version 2.38 to 2.39. This contains Various
262bugfixes, including compatibility fixes for older versions of Perl and vstring
263handling.
264
265=item *
266
5faa50e9
FR
267L<threads::shared> has been upgraded from version 1.40 to 1.41. This adds the
268option to warn about or ignore attempts to clone structures that can't be
269cloned, as opposed to just unconditionally dying in that case.
270
271=item *
272
273L<XSLoader> has been upgraded from version 0.15 to 0.16.
274
916c45d9 275=back
9c5f5e7a 276
916c45d9 277=head2 Removed Modules and Pragmata
9c5f5e7a 278
916c45d9 279=over 4
44db8156
SH
280
281=item *
282
916c45d9 283XXX
4f85bc45 284
4eabcf70 285=back
72267260 286
4eabcf70 287=head1 Documentation
72267260 288
916c45d9
SH
289XXX Changes to files in F<pod/> go here. Consider grouping entries by
290file and be sure to link to the appropriate page, e.g. L<perlfunc>.
95c6c5c5 291
916c45d9 292=head2 New Documentation
95c6c5c5 293
916c45d9 294XXX Changes which create B<new> files in F<pod/> go here.
95c6c5c5 295
916c45d9 296=head3 L<XXX>
95c6c5c5 297
916c45d9 298XXX Description of the purpose of the new file here
95c6c5c5 299
916c45d9
SH
300=head2 Changes to Existing Documentation
301
302XXX Changes which significantly change existing files in F<pod/> go here.
303However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
304section.
95c6c5c5 305
916c45d9 306=head3 L<XXX>
e114da46
FC
307
308=over 4
309
310=item *
311
916c45d9 312XXX Description of the change here
e114da46
FC
313
314=back
315
4eabcf70 316=head1 Diagnostics
05c8f9ed 317
4eabcf70
TC
318The following additions or changes have been made to diagnostic output,
319including warnings and fatal error messages. For the complete list of
320diagnostic messages, see L<perldiag>.
ceb0881c 321
916c45d9
SH
322XXX New or changed warnings emitted by the core's C<C> code go here. Also
323include any changes in L<perldiag> that reconcile it to the C<C> code.
324
4eabcf70 325=head2 New Diagnostics
42d72fc5 326
916c45d9
SH
327XXX Newly added diagnostic messages go under here, separated into New Errors
328and New Warnings
329
4eabcf70 330=head3 New Errors
8e125188 331
e96e0834 332=over 4
e128ab2c 333
e2f0c3bb
FC
334=item *
335
916c45d9 336XXX L<message|perldiag/"message">
3c774534 337
4eabcf70 338=back
e2f0c3bb 339
4eabcf70 340=head3 New Warnings
90519d0f 341
4eabcf70 342=over 4
90519d0f
FC
343
344=item *
345
916c45d9 346XXX L<message|perldiag/"message">
90519d0f 347
61174fb5 348=back
422287bf 349
916c45d9 350=head2 Changes to Existing Diagnostics
c95d4104 351
916c45d9 352XXX Changes (i.e. rewording) of diagnostic messages go here
7ab2ea42 353
4eabcf70 354=over 4
7ab2ea42 355
916c45d9 356=item *
7ab2ea42 357
916c45d9 358XXX Describe change here
90519d0f 359
4eabcf70 360=back
90519d0f 361
916c45d9 362=head1 Utility Changes
90519d0f 363
916c45d9
SH
364XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go here.
365Most of these are built within the directories F<utils> and F<x2p>.
d91f1bc9 366
916c45d9
SH
367[ List utility changes as a =head3 entry for each utility and =item
368entries for each change
369Use L<XXX> with program names to get proper documentation linking. ]
d91f1bc9 370
916c45d9 371=head3 L<XXX>
90519d0f 372
4eabcf70 373=over 4
90519d0f
FC
374
375=item *
376
916c45d9 377XXX
e9f497c4 378
916c45d9 379=back
e9f497c4 380
916c45d9 381=head1 Configuration and Compilation
d7f7c515 382
916c45d9
SH
383XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
384go here. Any other changes to the Perl build process should be listed here.
385However, any platform-specific changes should be listed in the
386L</Platform Support> section, instead.
d7f7c515 387
916c45d9 388[ List changes as a =item entry ].
afc04f16 389
916c45d9 390=over 4
afc04f16 391
b4cf37f5
FC
392=item *
393
5faa50e9
FR
394F<Configure> will now correctly detect C<isblank()> when compiling with a C++
395compiler.
b4cf37f5 396
916c45d9 397=back
b4cf37f5 398
916c45d9 399=head1 Testing
b4cf37f5 400
916c45d9
SH
401XXX Any significant changes to the testing of a freshly built perl should be
402listed here. Changes which create B<new> files in F<t/> go here as do any
403large changes to the testing harness (e.g. when parallel testing was added).
404Changes to existing files in F<t/> aren't worth summarizing, although the bugs
405that they represent may be covered elsewhere.
ea9f761d 406
916c45d9 407[ List each test improvement as a =item entry ]
70306497 408
916c45d9 409=over 4
70306497 410
63164165
FC
411=item *
412
916c45d9 413XXX
63164165 414
916c45d9 415=back
9da700a7 416
916c45d9 417=head1 Platform Support
9da700a7 418
916c45d9 419XXX Any changes to platform support should be listed in the sections below.
9702222b 420
916c45d9
SH
421[ Within the sections, list each platform as a =item entry with specific
422changes as paragraphs below it. ]
e4963eb6 423
916c45d9 424=head2 New Platforms
e4963eb6 425
916c45d9
SH
426XXX List any platforms that this version of perl compiles on, that previous
427versions did not. These will either be enabled by new files in the F<hints/>
428directories, or new subdirectories and F<README> files at the top level of the
429source tree.
3771623e 430
916c45d9 431=over 4
3771623e 432
916c45d9 433=item XXX-some-platform
9702222b 434
916c45d9 435XXX
3e0c76ce 436
916c45d9 437=back
610c7be4 438
916c45d9 439=head2 Discontinued Platforms
610c7be4 440
916c45d9 441=over 4
c58f5a32 442
043fec90 443=item VM/ESA
c58f5a32 444
043fec90
NC
445Support for VM/ESA has been removed. The port was tested on 2.3.0, which
446IBM ended service on in March 2002. 2.4.0 ended service in June 2003, and
447was superseded by Z/VM. The current version of Z/VM is V6.2.0, and scheduled
448for end of service on 2015/04/30.
a21a3918 449
916c45d9 450=back
a21a3918 451
916c45d9 452=head2 Platform-Specific Notes
a21a3918 453
916c45d9
SH
454XXX List any changes for specific platforms. This could include configuration
455and compilation changes or changes in portability/compatibility. However,
456changes within modules for platforms should generally be listed in the
457L</Modules and Pragmata> section.
a21a3918 458
916c45d9 459=over 4
60ca243a 460
5faa50e9 461=item Win32
60ca243a 462
3eebda9a
SH
463Fixed a problem where perl could crash while cleaning up threads (including the
464main thread) in threaded debugging builds on Win32 and possibly other platforms
465[perl #114496].
5faa50e9
FR
466
467=item Solaris
468
469In Configure, avoid running sed commands with flags not supported on Solaris.
470
471=item Darwin
472
473Stop hardcoding an alignment on 8 byte boundaries to fix builds using
474-Dusemorebits.
3771623e 475
eebee32b
FR
476=item VMS
477
478Fix linking on builds configured with -Dusemymalloc=y.
479
916c45d9 480=back
d91f1bc9 481
916c45d9 482=head1 Internal Changes
d91f1bc9 483
916c45d9
SH
484XXX Changes which affect the interface available to C<XS> code go here. Other
485significant internal changes for future core maintainers should be noted as
486well.
3771623e 487
916c45d9 488[ List each change as a =item entry ]
b4d67305 489
916c45d9 490=over 4
b4d67305 491
3c774534
SH
492=item *
493
5faa50e9
FR
494The APIs for accessing lexical pads have changed considerably.
495
496C<PADLIST>s are now longer C<AV>s, but their own type instead. C<PADLIST>s now
497contain a C<PAD> and a C<PADNAMELIST> of C<PADNAME>s, rather than C<AV>s for the
498pad and the list of pad names. C<PAD>s, C<PADNAMELIST>s, and C<PADNAME>s are to
499be accessed as such though the newly added pad API instead of the plain C<AV>
500and C<SV> APIs. See L<perlapi> for details.
d91f1bc9 501
050862bb
DM
502=item *
503
504In the regex API, the numbered capture callbacks are passed an index
505indicating what match variable is being accessed. There are special
506index values for the C<$`, $&, $&> variables. Previously the same three
507values were used to retrieve C<${^PREMATCH}, ${^MATCH}, ${^POSTMATCH}>
508too, but these have now been assigned three separate values. See
509L<perlreapi/Numbered capture callbacks>.
510
511=item *
512
513C<PL_sawampersand> was previously a boolean indicating that any of
514C<$`, $&, $&> had been seen; it now contains three one-bit flags
515indicating the presence of each of the variables individually.
516
916c45d9 517=back
d91f1bc9 518
916c45d9 519=head1 Selected Bug Fixes
d91f1bc9 520
916c45d9
SH
521XXX Important bug fixes in the core language are summarized here. Bug fixes in
522files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>.
d91f1bc9 523
916c45d9 524=over 4
d91f1bc9
SH
525
526=item *
527
5faa50e9
FR
528Restore ‘Can’t localize through ref’ to lvalue subs. This error had disappeared
529under certain conditions in version 5.16.0 and has now been restored.
530
531=item *
532
533The parsing of heredocs has been improved significantly, fixing several parsing
534bugs and correcting wrong subsequent line numbers under certain conditions.
535
536=item *
537
538Reset the utf8 position cache when accessing magical variables to avoid the
539string buffer and the utf8 position cache to get out of sync.
540
541=item *
542
543Various cases of get magic being called twice for magical utf8 strings have been
544fixed.
545
546=item *
547
548This code (when not in the presence of C<$&> etc)
549
550 $_ = 'x' x 1_000_000;
551 1 while /(.)/;
552
553used to skip the buffer copy for performance reasons, but suffered from C<$1>
554etc changing if the original string changed. That's now been fixed.
555
556=item *
557
558Perl doesn't use PerlIO anymore to report out of memory messages, as PerlIO
559might attempt to allocate more memory.
d91f1bc9 560
31c15ce5
KW
561=item *
562
563In a regular expression, if something is quantified with C<{n,m}>
564where C<S<n E<gt> m>>, it can't possibly match. Previously this was a fatal error,
565but now is merely a warning (and that something won't match). [perl #82954].
566
916c45d9 567=back
d91f1bc9 568
916c45d9 569=head1 Known Problems
d91f1bc9 570
916c45d9
SH
571XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
572tests that had to be C<TODO>ed for the release would be noted here. Unfixed
573platform specific bugs also go here.
d91f1bc9 574
916c45d9 575[ List each fix as a =item entry ]
216d99a6 576
916c45d9 577=over 4
216d99a6
FC
578
579=item *
580
5faa50e9
FR
581Changes in the lexical pad API break several CPAN modules.
582
583To avoid having to patch those modules again later if we change pads from AVs
584into their own types, APIs for accessing the contents of pads have been added.
216d99a6 585
4eabcf70 586=back
90519d0f 587
916c45d9 588=head1 Obituary
05bee12a 589
916c45d9
SH
590XXX If any significant core contributor has died, we've added a short obituary
591here.
05bee12a 592
916c45d9 593=head1 Acknowledgements
05bee12a 594
916c45d9 595XXX Generate this with:
05bee12a 596
916c45d9 597 perl Porting/acknowledgements.pl v5.17.3..HEAD
29cf780c 598
44691e6f
AB
599=head1 Reporting Bugs
600
e08634c5
SH
601If you find what you think is a bug, you might check the articles recently
602posted to the comp.lang.perl.misc newsgroup and the perl bug database at
603http://rt.perl.org/perlbug/ . There may also be information at
604http://www.perl.org/ , the Perl Home Page.
44691e6f 605
e08634c5
SH
606If you believe you have an unreported bug, please run the L<perlbug> program
607included with your release. Be sure to trim your bug down to a tiny but
608sufficient test case. Your bug report, along with the output of C<perl -V>,
609will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
44691e6f
AB
610
611If the bug you are reporting has security implications, which make it
e08634c5
SH
612inappropriate to send to a publicly archived mailing list, then please send it
613to perl5-security-report@perl.org. This points to a closed subscription
614unarchived mailing list, which includes all the core committers, who will be
615able to help assess the impact of issues, figure out a resolution, and help
f9001595 616co-ordinate the release of patches to mitigate or fix the problem across all
e08634c5
SH
617platforms on which Perl is supported. Please only use this address for
618security issues in the Perl core, not for modules independently distributed on
619CPAN.
44691e6f
AB
620
621=head1 SEE ALSO
622
e08634c5
SH
623The F<Changes> file for an explanation of how to view exhaustive details on
624what changed.
44691e6f
AB
625
626The F<INSTALL> file for how to build Perl.
627
628The F<README> file for general stuff.
629
630The F<Artistic> and F<Copying> files for copyright information.
631
632=cut