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