This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta for bb4784f00 (Constant(undef))
[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
7564097e
FC
281L<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>
282
283Constant overloading that returns C<undef> results in this error message.
284For numeric constants, it used to say "Constant(undef)". "undef" has been
285replaced with the number itself.
ddb1bef5 286
e14ac59b 287=back
5faa50e9 288
e14ac59b 289=head1 Utility Changes
5faa50e9 290
e14ac59b
RS
291XXX Changes to installed programs such as F<perlbug> and F<xsubpp> go here.
292Most of these are built within the directories F<utils> and F<x2p>.
5faa50e9 293
e14ac59b
RS
294[ List utility changes as a =head3 entry for each utility and =item
295entries for each change
296Use L<XXX> with program names to get proper documentation linking. ]
297
298=head3 L<XXX>
5faa50e9 299
5d8c8c8a 300=over 4
5faa50e9
FR
301
302=item *
303
e14ac59b 304XXX
cb077ed2 305
e14ac59b
RS
306=back
307
308=head1 Configuration and Compilation
309
310XXX Changes to F<Configure>, F<installperl>, F<installman>, and analogous tools
311go here. Any other changes to the Perl build process should be listed here.
312However, any platform-specific changes should be listed in the
313L</Platform Support> section, instead.
cb077ed2 314
e14ac59b
RS
315[ List changes as a =item entry ].
316
317=over 4
90814a4e 318
5ce83ae9
DM
319=item *
320
e14ac59b 321XXX
5ce83ae9 322
5d8c8c8a 323=back
31c15ce5 324
e14ac59b
RS
325=head1 Testing
326
327XXX Any significant changes to the testing of a freshly built perl should be
328listed here. Changes which create B<new> files in F<t/> go here as do any
329large changes to the testing harness (e.g. when parallel testing was added).
330Changes to existing files in F<t/> aren't worth summarizing, although the bugs
331that they represent may be covered elsewhere.
332
333[ List each test improvement as a =item entry ]
4db91b87 334
5d8c8c8a 335=over 4
4db91b87
FC
336
337=item *
338
e14ac59b 339XXX
11e375e0 340
e14ac59b 341=back
11e375e0 342
e14ac59b 343=head1 Platform Support
11e375e0 344
e14ac59b 345XXX Any changes to platform support should be listed in the sections below.
11e375e0 346
e14ac59b
RS
347[ Within the sections, list each platform as a =item entry with specific
348changes as paragraphs below it. ]
11e375e0 349
e14ac59b 350=head2 New Platforms
11e375e0 351
e14ac59b
RS
352XXX List any platforms that this version of perl compiles on, that previous
353versions did not. These will either be enabled by new files in the F<hints/>
354directories, or new subdirectories and F<README> files at the top level of the
355source tree.
11e375e0 356
e14ac59b 357=over 4
11e375e0 358
e14ac59b 359=item XXX-some-platform
11e375e0 360
e14ac59b 361XXX
11e375e0 362
e14ac59b 363=back
11e375e0 364
e14ac59b 365=head2 Discontinued Platforms
11e375e0 366
e14ac59b 367=over 4
11e375e0 368
b6c36746 369=item BeOS
11e375e0 370
b6c36746 371Support for BeOS has been removed.
11e375e0 372
e14ac59b 373=back
11e375e0 374
e14ac59b 375=head2 Platform-Specific Notes
11e375e0 376
e14ac59b
RS
377XXX List any changes for specific platforms. This could include configuration
378and compilation changes or changes in portability/compatibility. However,
379changes within modules for platforms should generally be listed in the
380L</Modules and Pragmata> section.
11e375e0 381
e14ac59b 382=over 4
11e375e0 383
e14ac59b 384=item XXX-some-platform
11e375e0 385
e14ac59b 386XXX
11e375e0 387
e14ac59b 388=back
11e375e0 389
e14ac59b 390=head1 Internal Changes
11e375e0 391
e14ac59b
RS
392XXX Changes which affect the interface available to C<XS> code go here. Other
393significant internal changes for future core maintainers should be noted as
394well.
11e375e0 395
e14ac59b 396[ List each change as a =item entry ]
11e375e0 397
e14ac59b 398=over 4
11e375e0
FC
399
400=item *
401
463ea229
DM
402SvUPGRADE() is no longer an expression. Originally this macro (and its
403underlying function, sv_upgrade()) were documented as boolean, although
404in reality they always croaked on error and never returned false. In 2005
405the documentation was updated to specify a void return value, but
406SvUPGRADE() was left always returning 1 for backwards compatibility. This
407has now been removed, and SvUPGRADE() is now a statement with no return
408value.
409
410So this is now a syntax error:
411
412 if (!SvUPGRADE(sv)) { croak(...); }
413
414If you have code like that, simply replace it with
415
416 SvUPGRADE(sv);
e14ac59b 417
8b877d20
DM
418or to to avoid compiler warnings with older perls, possibly
419
420 (void)SvUPGRADE(sv);
421
e078d89d
FC
422=item *
423
424Perl has a new copy-on-write mechanism that allows any SvPOK scalar to be
425upgraded to a copy-on-write scalar. A reference count on the string buffer
426is stored in the string buffer itself.
427
428This breaks a few XS modules by allowing copy-on-write scalars to go
429through code paths that never encountered them before.
430
431This behaviour can still be disabled by running F<Configure> with
432B<-Accflags=-DPERL_NO_COW>. This option will probably be removed in Perl
4335.20.
434
435=item *
436
437Copy-on-write no longer uses the SvFAKE and SvREADONLY flags. Hence,
438SvREADONLY indicates a true read-only SV.
439
440Use the SvIsCOW macro (as before) to identify a copy-on-write scalar.
441
442=item *
443
444C<PL_sawampersand> is now a constant. The switch this variable provided
445(to enable/disable the pre-match copy depending on whether C<$&> had been
446seen) has been removed and replaced with copy-on-write, eliminating a few
447bugs.
448
449The previous behaviour can still be enabled by running F<Configure> with
450B<-Accflags=-DPERL_SAWAMPERSAND>.
451
e14ac59b
RS
452=back
453
454=head1 Selected Bug Fixes
455
456XXX Important bug fixes in the core language are summarized here. Bug fixes in
457files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>.
458
459[ List each fix as a =item entry ]
460
461=over 4
11e375e0
FC
462
463=item *
464
8b998a90
FC
465C<sort {undef} ...> under fatal warnings no longer crashes. It started
466crashing in Perl 5.16.
e14ac59b 467
fdea6f98
FC
468=item *
469
470Stashes blessed into each other
471(C<bless \%Foo::, 'Bar'; bless \%Bar::, 'Foo'>) no longer result in double
472frees. This bug started happening in Perl 5.16.
473
7cf3104f
FC
474=item *
475
476Numerous memory leaks have been fixed, mostly involving fatal warnings and
477syntax errors.
478
966f0fdb
FC
479=item *
480
481Lexical constants (C<my sub answer () { 42 }>) no longer cause double
482frees.
483
edc013cb
FC
484=item *
485
486Constant subroutine redefinition warns by default, but lexical constants
487were accidentally exempt from default warnings. This has been corrected.
488
7b5dd02a
FC
489=item *
490
491Some failed regular expression matches such as C<'f' =~ /../g> were not
492resetting C<pos>. Also, "match-once" patterns (C<m?...?g>) failed to reset
493it, too, when invoked a second time [perl #23180].
494
e078d89d
FC
495=item *
496
497Accessing C<$&> after a pattern match now works if it had not been seen
498before the match. I.e., this applies to C<${'&'}> (under C<no strict>) and
499C<eval '$&'>. The same applies to C<$'> and C<$`> [perl #4289].
500
a0e45bac
FC
501=item *
502
07a22236 503Several bugs involving C<local *ISA> and C<local *Foo::> causing stale
a0e45bac
FC
504MRO caches have been fixed.
505
139353f8
FC
506=item *
507
508Defining a subroutine when its typeglob has been aliased no longer results
509in stale method caches. This bug was introduced in Perl 5.10.
510
ba535ffe
FC
511=item *
512
513Localising a typeglob containing a subroutine when the typeglob's package
514has been deleted from its parent stash no longer produces an error. This
515bug was introduced in Perl 5.14.
516
52c09c59
FC
517=item *
518
519Under some circumstances, C<local *method=...> would fail to reset method
520caches upon scope exit.
521
12b847a2
FC
522=item *
523
524C</[.foo.]/> is no longer an error, but produces a warning (as before) and
525is treated as C</[.fo]/> [perl #115818].
526
6e50262c
FC
527=item *
528
529C<goto $tied_var> now calls FETCH before deciding what type of goto
530(subroutine or label) this is.
531
785fb813
FC
532=item *
533
534Renaming packages through glob assignment
535(C<*Foo:: = *Bar::; *Bar:: = *Baz::>) in combination with C<m?...?> and
536C<reset> no longer makes threaded builds crash.
537
f5778209
FC
538=item *
539
540An earlier release in the 5.17.x series could crash if user code prevented
541_charnames from loading via C<$INC{'_charnames.pm'}++>.
542
e14ac59b
RS
543=back
544
545=head1 Known Problems
546
547XXX Descriptions of platform agnostic bugs we know we can't fix go here. Any
548tests that had to be C<TODO>ed for the release would be noted here. Unfixed
549platform specific bugs also go here.
550
551[ List each fix as a =item entry ]
552
553=over 4
2d9cd31f 554
c9ac5216
FC
555=item *
556
e14ac59b 557XXX
c9ac5216 558
5d8c8c8a 559=back
4db91b87 560
e14ac59b
RS
561=head1 Obituary
562
563XXX If any significant core contributor has died, we've added a short obituary
564here.
565
916c45d9 566=head1 Acknowledgements
05bee12a 567
e14ac59b
RS
568XXX Generate this with:
569
570 perl Porting/acknowledgements.pl v5.17.6..HEAD
29cf780c 571
44691e6f
AB
572=head1 Reporting Bugs
573
e08634c5
SH
574If you find what you think is a bug, you might check the articles recently
575posted to the comp.lang.perl.misc newsgroup and the perl bug database at
576http://rt.perl.org/perlbug/ . There may also be information at
577http://www.perl.org/ , the Perl Home Page.
44691e6f 578
e08634c5
SH
579If you believe you have an unreported bug, please run the L<perlbug> program
580included with your release. Be sure to trim your bug down to a tiny but
581sufficient test case. Your bug report, along with the output of C<perl -V>,
582will be sent off to perlbug@perl.org to be analysed by the Perl porting team.
44691e6f
AB
583
584If the bug you are reporting has security implications, which make it
e08634c5
SH
585inappropriate to send to a publicly archived mailing list, then please send it
586to perl5-security-report@perl.org. This points to a closed subscription
587unarchived mailing list, which includes all the core committers, who will be
588able to help assess the impact of issues, figure out a resolution, and help
f9001595 589co-ordinate the release of patches to mitigate or fix the problem across all
e08634c5
SH
590platforms on which Perl is supported. Please only use this address for
591security issues in the Perl core, not for modules independently distributed on
592CPAN.
44691e6f
AB
593
594=head1 SEE ALSO
595
e08634c5
SH
596The F<Changes> file for an explanation of how to view exhaustive details on
597what changed.
44691e6f
AB
598
599The F<INSTALL> file for how to build Perl.
600
601The F<README> file for general stuff.
602
603The F<Artistic> and F<Copying> files for copyright information.
604
605=cut