This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta for 959f7ad7 (local *Detached::method)
[perl5.git] / pod / perldelta.pod
CommitLineData
44691e6f
AB
1=encoding utf8
2
3=head1 NAME
4
e14ac59b
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.17.7
e128ab2c 9
4eabcf70 10=head1 DESCRIPTION
6db9054f 11
e14ac59b 12This document describes differences between the 5.17.6 release and the 5.17.7
e08634c5 13release.
6db9054f 14
e14ac59b
RS
15If you are upgrading from an earlier release such as 5.17.5, first read
16L<perl5176delta>, which describes differences between 5.17.5 and 5.17.6.
17
18=head1 Notice
19
20XXX Any important notices here
5faa50e9 21
5d8c8c8a 22=head1 Core Enhancements
4db91b87 23
e078d89d 24=head2 $&, $` and $' are no longer slow
bde9e88d 25
e078d89d
FC
26These three infamous variables have been redeemed and no longer slow down
27your program when used. Hence, the /p regular expression flag now does
28nothing.
bde9e88d 29
e14ac59b 30=head1 Security
86148eee 31
e14ac59b
RS
32XXX Any security-related notices go here. In particular, any security
33vulnerabilities closed should be noted here rather than in the
34L</Selected Bug Fixes> section.
86148eee 35
e14ac59b 36[ List each security issue as a =head2 entry ]
9c5f5e7a 37
e14ac59b 38=head1 Incompatible Changes
90249f0a 39
3ef6ec90
TC
40=head2 readline() with C<$/ = \N> now reads N characters, not N bytes
41
42Previously, when reading from a stream with I/O layers such as
43C<encoding>, the readline() function, otherwise known as the C<< <> >>
44operator, would read I<N> bytes from the top-most layer. [perl #79960]
45
46Now, I<N> characters are read instead.
47
48There is no change in behaviour when reading from streams with no
49extra layers, since bytes map exactly to characters.
50
9a0708b2 51=head2 Lexical subroutine warnings have moved
90249f0a 52
9a0708b2
FC
53The warning about the use of an experimental feature emitted when lexical
54subroutines (added in 5.17.4) are used now happens when the subroutine
55itself is declared, not when the "lexical_subs" feature is activated via
56C<use feature>.
4d7cd482 57
9a0708b2
FC
58This stops C<use feature ':all'> from warning, but causes
59C<my sub foo; my sub bar> to warn twice.
4d7cd482 60
e14ac59b 61=head1 Deprecations
4d7cd482 62
e14ac59b
RS
63XXX Any deprecated features, syntax, modules etc. should be listed here. In
64particular, deprecated modules should be listed here even if they are listed as
65an updated module in the L</Modules and Pragmata> section.
4d7cd482 66
e14ac59b 67[ List each deprecation as a =head2 entry ]
86148eee 68
61b19385
KW
69=head2 Various XS-callable functions are now deprecated
70
71The following functions will be removed from a future version of Perl,
72and should not be used. With participating C compilers (e.g., gcc),
73compiling any file that uses any of these will generate a warning.
74These were not intended for public use; there are equivalent, faster,
75macros for most of them. See L<perlapi/Character classes>:
76C<is_uni_ascii>,
77C<is_uni_ascii_lc>,
78C<is_uni_blank>,
79C<is_uni_blank_lc>,
80C<is_uni_cntrl>,
81C<is_uni_cntrl_lc>,
82C<is_uni_idfirst_lc>,
83C<is_uni_space>,
84C<is_uni_space_lc>,
85C<is_uni_xdigit>,
86C<is_uni_xdigit_lc>,
87C<is_utf8_ascii>,
88C<is_utf8_blank>,
89C<is_utf8_cntrl>,
90C<is_utf8_idcont>,
91C<is_utf8_idfirst>,
92C<is_utf8_perl_space>,
93C<is_utf8_perl_word>,
94C<is_utf8_posix_digit>,
95C<is_utf8_space>,
96C<is_utf8_xdigit>.
97C<is_utf8_xidcont>,
98C<is_utf8_xidfirst>,
99C<to_uni_lower_lc>,
100C<to_uni_title_lc>,
101and
102C<to_uni_upper_lc>.
103
e14ac59b 104=head1 Performance Enhancements
86148eee 105
e14ac59b
RS
106XXX Changes which enhance performance without changing behaviour go here.
107There may well be none in a stable release.
86148eee 108
e14ac59b 109[ List each enhancement as a =item entry ]
1611045a 110
e14ac59b 111=over 4
7a7a10c7 112
e14ac59b 113=item *
7a7a10c7 114
e078d89d
FC
115Perl has a new copy-on-write mechanism that avoids the need to copy the
116internal string buffer when assigning from one scalar to another. This
117makes copying large strings appear much faster. Modifying one of the two
118(or more) strings after an assignment will force a copy internally. This
119makes it unnecessary to pass strings by reference for efficiency.
7a7a10c7 120
e14ac59b 121=back
7a7a10c7 122
e14ac59b 123=head1 Modules and Pragmata
7a7a10c7 124
e14ac59b
RS
125XXX All changes to installed files in F<cpan/>, F<dist/>, F<ext/> and F<lib/>
126go here. If Module::CoreList is updated, generate an initial draft of the
127following sections using F<Porting/corelist-perldelta.pl>, which prints stub
128entries to STDOUT. Results can be pasted in place of the '=head2' entries
129below. A paragraph summary for important changes should then be added by hand.
130In an ideal world, dual-life modules would have a F<Changes> file that could be
131cribbed.
7a7a10c7 132
e14ac59b 133[ Within each section, list entries as a =item entry ]
7a7a10c7 134
e14ac59b 135=head2 New Modules and Pragmata
45f11e9c 136
916c45d9 137=over 4
338a1057
SH
138
139=item *
140
e14ac59b 141XXX
0ace302a 142
e14ac59b 143=back
32209f41 144
e14ac59b 145=head2 Updated Modules and Pragmata
c387386a 146
e14ac59b 147=over 4
32209f41 148
e14ac59b 149=item *
5faa50e9 150
476161f6
NC
151L<GDBM_File> has been upgraded from version 1.14 to 1.15. The undocumented
152optional fifth parameter to C<TIEHASH> has been removed. This was intended
153to provide control of the callback used by C<gdbm*> functions in case of
154fatal errors (such as filesystem problems), but did not work (and could
155never have worked). No code on CPAN even attempted to use it. The callback
156is now always the previous default, C<croak>. Problems on some platforms with
157how the C<C> C<croak> function is called have also been resolved.
5faa50e9 158
e14ac59b
RS
159=back
160
161=head2 Removed Modules and Pragmata
4cc02608 162
916c45d9 163=over 4
e7b92d54
SH
164
165=item *
166
e14ac59b 167XXX
11e375e0 168
e14ac59b 169=back
11e375e0 170
e14ac59b 171=head1 Documentation
11e375e0 172
e14ac59b
RS
173XXX Changes to files in F<pod/> go here. Consider grouping entries by
174file and be sure to link to the appropriate page, e.g. L<perlfunc>.
7b379596 175
e14ac59b 176=head2 New Documentation
5c26a176 177
e14ac59b 178XXX Changes which create B<new> files in F<pod/> go here.
5c26a176 179
e14ac59b 180=head3 L<XXX>
cb077ed2 181
e14ac59b 182XXX Description of the purpose of the new file here
11e375e0 183
e14ac59b 184=head2 Changes to Existing Documentation
11e375e0 185
e14ac59b
RS
186XXX Changes which significantly change existing files in F<pod/> go here.
187However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics>
188section.
189
243effed 190=head3 L<perlapi/Character classes>
11e375e0 191
e14ac59b 192=over 4
e498bd59
RS
193
194=item *
195
243effed
KW
196There are quite a few macros callable from XS modules that classify
197characters into things like alphabetic, punctuation, etc. More of these
198are now documented, including ones which work on characters whose code
199points are outside the Latin-1 range.
cb077ed2 200
5d8c8c8a 201=back
5f877a7f 202
e14ac59b
RS
203=head1 Diagnostics
204
205The following additions or changes have been made to diagnostic output,
206including warnings and fatal error messages. For the complete list of
207diagnostic messages, see L<perldiag>.
1ea91bbe 208
e14ac59b
RS
209XXX New or changed warnings emitted by the core's C<C> code go here. Also
210include any changes in L<perldiag> that reconcile it to the C<C> code.
211
212=head2 New Diagnostics
213
214XXX Newly added diagnostic messages go under here, separated into New Errors
215and New Warnings
216
217=head3 New Errors
5faa50e9 218
5d8c8c8a 219=over 4
1ea91bbe
FR
220
221=item *
222
e14ac59b 223XXX L<message|perldiag/"message">
5faa50e9 224
916c45d9 225=back
9c5f5e7a 226
e14ac59b 227=head3 New Warnings
4db91b87 228
5d8c8c8a 229=over 4
4db91b87 230
e14ac59b 231=item *
4db91b87 232
e14ac59b 233XXX L<message|perldiag/"message">
4db91b87 234
5d8c8c8a 235=back
5faa50e9 236
e14ac59b
RS
237=head2 Changes to Existing Diagnostics
238
239XXX Changes (i.e. rewording) of diagnostic messages go here
5faa50e9 240
5d8c8c8a 241=over 4
5faa50e9 242
e14ac59b 243=item *
ddb1bef5 244
e14ac59b 245XXX Describe change here
ddb1bef5 246
e14ac59b 247=back
5faa50e9 248
e14ac59b 249=head1 Utility Changes
5faa50e9 250
e14ac59b
RS
251XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go here.
252Most of these are built within the directories F<utils> and F<x2p>.
5faa50e9 253
e14ac59b
RS
254[ List utility changes as a =head3 entry for each utility and =item
255entries for each change
256Use L<XXX> with program names to get proper documentation linking. ]
257
258=head3 L<XXX>
5faa50e9 259
5d8c8c8a 260=over 4
5faa50e9
FR
261
262=item *
263
e14ac59b 264XXX
cb077ed2 265
e14ac59b
RS
266=back
267
268=head1 Configuration and Compilation
269
270XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
271go here. Any other changes to the Perl build process should be listed here.
272However, any platform-specific changes should be listed in the
273L</Platform Support> section, instead.
cb077ed2 274
e14ac59b
RS
275[ List changes as a =item entry ].
276
277=over 4
90814a4e 278
5ce83ae9
DM
279=item *
280
e14ac59b 281XXX
5ce83ae9 282
5d8c8c8a 283=back
31c15ce5 284
e14ac59b
RS
285=head1 Testing
286
287XXX Any significant changes to the testing of a freshly built perl should be
288listed here. Changes which create B<new> files in F<t/> go here as do any
289large changes to the testing harness (e.g. when parallel testing was added).
290Changes to existing files in F<t/> aren't worth summarizing, although the bugs
291that they represent may be covered elsewhere.
292
293[ List each test improvement as a =item entry ]
4db91b87 294
5d8c8c8a 295=over 4
4db91b87
FC
296
297=item *
298
e14ac59b 299XXX
11e375e0 300
e14ac59b 301=back
11e375e0 302
e14ac59b 303=head1 Platform Support
11e375e0 304
e14ac59b 305XXX Any changes to platform support should be listed in the sections below.
11e375e0 306
e14ac59b
RS
307[ Within the sections, list each platform as a =item entry with specific
308changes as paragraphs below it. ]
11e375e0 309
e14ac59b 310=head2 New Platforms
11e375e0 311
e14ac59b
RS
312XXX List any platforms that this version of perl compiles on, that previous
313versions did not. These will either be enabled by new files in the F<hints/>
314directories, or new subdirectories and F<README> files at the top level of the
315source tree.
11e375e0 316
e14ac59b 317=over 4
11e375e0 318
e14ac59b 319=item XXX-some-platform
11e375e0 320
e14ac59b 321XXX
11e375e0 322
e14ac59b 323=back
11e375e0 324
e14ac59b 325=head2 Discontinued Platforms
11e375e0 326
e14ac59b 327=over 4
11e375e0 328
b6c36746 329=item BeOS
11e375e0 330
b6c36746 331Support for BeOS has been removed.
11e375e0 332
e14ac59b 333=back
11e375e0 334
e14ac59b 335=head2 Platform-Specific Notes
11e375e0 336
e14ac59b
RS
337XXX List any changes for specific platforms. This could include configuration
338and compilation changes or changes in portability/compatibility. However,
339changes within modules for platforms should generally be listed in the
340L</Modules and Pragmata> section.
11e375e0 341
e14ac59b 342=over 4
11e375e0 343
e14ac59b 344=item XXX-some-platform
11e375e0 345
e14ac59b 346XXX
11e375e0 347
e14ac59b 348=back
11e375e0 349
e14ac59b 350=head1 Internal Changes
11e375e0 351
e14ac59b
RS
352XXX Changes which affect the interface available to C<XS> code go here. Other
353significant internal changes for future core maintainers should be noted as
354well.
11e375e0 355
e14ac59b 356[ List each change as a =item entry ]
11e375e0 357
e14ac59b 358=over 4
11e375e0
FC
359
360=item *
361
463ea229
DM
362SvUPGRADE() is no longer an expression. Originally this macro (and its
363underlying function, sv_upgrade()) were documented as boolean, although
364in reality they always croaked on error and never returned false. In 2005
365the documentation was updated to specify a void return value, but
366SvUPGRADE() was left always returning 1 for backwards compatibility. This
367has now been removed, and SvUPGRADE() is now a statement with no return
368value.
369
370So this is now a syntax error:
371
372 if (!SvUPGRADE(sv)) { croak(...); }
373
374If you have code like that, simply replace it with
375
376 SvUPGRADE(sv);
e14ac59b 377
8b877d20
DM
378or to to avoid compiler warnings with older perls, possibly
379
380 (void)SvUPGRADE(sv);
381
e078d89d
FC
382=item *
383
384Perl has a new copy-on-write mechanism that allows any SvPOK scalar to be
385upgraded to a copy-on-write scalar. A reference count on the string buffer
386is stored in the string buffer itself.
387
388This breaks a few XS modules by allowing copy-on-write scalars to go
389through code paths that never encountered them before.
390
391This behaviour can still be disabled by running F<Configure> with
392B<-Accflags=-DPERL_NO_COW>. This option will probably be removed in Perl
3935.20.
394
395=item *
396
397Copy-on-write no longer uses the SvFAKE and SvREADONLY flags. Hence,
398SvREADONLY indicates a true read-only SV.
399
400Use the SvIsCOW macro (as before) to identify a copy-on-write scalar.
401
402=item *
403
404C<PL_sawampersand> is now a constant. The switch this variable provided
405(to enable/disable the pre-match copy depending on whether C<$&> had been
406seen) has been removed and replaced with copy-on-write, eliminating a few
407bugs.
408
409The previous behaviour can still be enabled by running F<Configure> with
410B<-Accflags=-DPERL_SAWAMPERSAND>.
411
e14ac59b
RS
412=back
413
414=head1 Selected Bug Fixes
415
416XXX Important bug fixes in the core language are summarized here. Bug fixes in
417files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>.
418
419[ List each fix as a =item entry ]
420
421=over 4
11e375e0
FC
422
423=item *
424
8b998a90
FC
425C<sort {undef} ...> under fatal warnings no longer crashes. It started
426crashing in Perl 5.16.
e14ac59b 427
fdea6f98
FC
428=item *
429
430Stashes blessed into each other
431(C<bless \%Foo::, 'Bar'; bless \%Bar::, 'Foo'>) no longer result in double
432frees. This bug started happening in Perl 5.16.
433
7cf3104f
FC
434=item *
435
436Numerous memory leaks have been fixed, mostly involving fatal warnings and
437syntax errors.
438
966f0fdb
FC
439=item *
440
441Lexical constants (C<my sub answer () { 42 }>) no longer cause double
442frees.
443
edc013cb
FC
444=item *
445
446Constant subroutine redefinition warns by default, but lexical constants
447were accidentally exempt from default warnings. This has been corrected.
448
7b5dd02a
FC
449=item *
450
451Some failed regular expression matches such as C<'f' =~ /../g> were not
452resetting C<pos>. Also, "match-once" patterns (C<m?...?g>) failed to reset
453it, too, when invoked a second time [perl #23180].
454
e078d89d
FC
455=item *
456
457Accessing C<$&> after a pattern match now works if it had not been seen
458before the match. I.e., this applies to C<${'&'}> (under C<no strict>) and
459C<eval '$&'>. The same applies to C<$'> and C<$`> [perl #4289].
460
a0e45bac
FC
461=item *
462
463Two minor bugs involving C<local *ISA> and C<local *Foo::> causing stale
464MRO caches have been fixed.
465
139353f8
FC
466=item *
467
468Defining a subroutine when its typeglob has been aliased no longer results
469in stale method caches. This bug was introduced in Perl 5.10.
470
ba535ffe
FC
471=item *
472
473Localising a typeglob containing a subroutine when the typeglob's package
474has been deleted from its parent stash no longer produces an error. This
475bug was introduced in Perl 5.14.
476
e14ac59b
RS
477=back
478
479=head1 Known Problems
480
481XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
482tests that had to be C<TODO>ed for the release would be noted here. Unfixed
483platform specific bugs also go here.
484
485[ List each fix as a =item entry ]
486
487=over 4
2d9cd31f 488
c9ac5216
FC
489=item *
490
e14ac59b 491XXX
c9ac5216 492
5d8c8c8a 493=back
4db91b87 494
e14ac59b
RS
495=head1 Obituary
496
497XXX If any significant core contributor has died, we've added a short obituary
498here.
499
916c45d9 500=head1 Acknowledgements
05bee12a 501
e14ac59b
RS
502XXX Generate this with:
503
504 perl Porting/acknowledgements.pl v5.17.6..HEAD
29cf780c 505
44691e6f
AB
506=head1 Reporting Bugs
507
e08634c5
SH
508If you find what you think is a bug, you might check the articles recently
509posted to the comp.lang.perl.misc newsgroup and the perl bug database at
510http://rt.perl.org/perlbug/ . There may also be information at
511http://www.perl.org/ , the Perl Home Page.
44691e6f 512
e08634c5
SH
513If you believe you have an unreported bug, please run the L<perlbug> program
514included with your release. Be sure to trim your bug down to a tiny but
515sufficient test case. Your bug report, along with the output of C<perl -V>,
516will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
44691e6f
AB
517
518If the bug you are reporting has security implications, which make it
e08634c5
SH
519inappropriate to send to a publicly archived mailing list, then please send it
520to perl5-security-report@perl.org. This points to a closed subscription
521unarchived mailing list, which includes all the core committers, who will be
522able to help assess the impact of issues, figure out a resolution, and help
f9001595 523co-ordinate the release of patches to mitigate or fix the problem across all
e08634c5
SH
524platforms on which Perl is supported. Please only use this address for
525security issues in the Perl core, not for modules independently distributed on
526CPAN.
44691e6f
AB
527
528=head1 SEE ALSO
529
e08634c5
SH
530The F<Changes> file for an explanation of how to view exhaustive details on
531what changed.
44691e6f
AB
532
533The F<INSTALL> file for how to build Perl.
534
535The F<README> file for general stuff.
536
537The F<Artistic> and F<Copying> files for copyright information.
538
539=cut