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