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